Questions tagged [performance]

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

Filter by
Sorted by
Tagged with
1
vote
0answers
21 views

Inserting captions under photographs in word based on entries in excel spreadsheet

I have a macro written in word for transferring captions written in excel to a corresponding photograph in a word document. At the moment it runs however I am finding that it slows down over time the ...
-1
votes
1answer
60 views

Passing a partial application as an argument of an other function with no overhead [closed]

I am trying to find a way to pass a partial application as an argument of an other application with no overhead. I think I have find a way to do it (which might be dirty). The templated structure &...
1
vote
1answer
36 views

tokenize char array with PolarSSL library

I'm trying to perform a decryption operation using RSA. I'm using the PolarSSl library. I have a char array key[] that contains RSA private key like the following, <...
3
votes
1answer
73 views

Java i/o speed less than python i/o while printing an array

Motivation: I was solving an array based i/o problem and encountered Time Limit Errors, it was later found that the code for java ran roughly 10x slower than the ...
2
votes
1answer
46 views

Tiny attempt at a register machine in Nim

I am attempting to learn the Nim language by making a small and simplistic register machine. It is intended to interpret some basic instructions. The entire parsing lexing process consists of ...
1
vote
0answers
90 views

Computing the angle between two vectors (vectorized) for small angles and with few copies

I am implementing a function that computes the angle between two vectors when given two n-dimensional arrays and an axis along which to operate. I want to do this with as few copies as possible, and ...
3
votes
0answers
56 views

Speed Up API Requests & Overall Python Code

I'm not asking for help solving a problem but rather asking for help for possible ways to improve the speed of my program. Essentially what this does is: Tracks market data by pulling the data from ...
3
votes
3answers
120 views

Image Processing Sobel Edge Detection in C

This is a follow-up question for Image Processing Median Filter in C. Under the same tiny bmp image read / write framework, a sobel edge detection function has been performed. The experimental ...
4
votes
2answers
121 views

Merge two pulses if they match

The function processFus() takes : Two lists of pulses (200 000 in each), as an input Two lists of pulse, empty, pulseValid and invalid. The function must fill them ...
0
votes
1answer
21 views

Rotation Management Application

My code works just fine but it seems like I have too many variables which could confuse people from what the code does. Any ideas? Or does this look fine. Feel free to add any other tips to make my ...
5
votes
0answers
228 views

Multithreaded pathfinding in Unity C#

I've tried to implement multithreaded pathfinding in an attempt to increase performance, but if anything, performance seems to actually decrease when I enable multithreading. Is there anything I ...
2
votes
1answer
56 views

Find the most similar pair of rows from a table

I have a list of n cities and hourly weather prediction for each one of them for h hours. I'm writing a script to find a pair of ...
3
votes
2answers
264 views

Python 3 approximate pi using 9 algorithms

Note: this script requires gmpy2, if you are using Python 3.9.5 x64 on Windows 10 21H1 like me, then you need to download the pre-built ...
2
votes
1answer
56 views

Optimizing telegram bot

I was working on one telgram bot, and when finally i made everything i discovered that it is extremely slow. def s takes 5-7 seconds to get result and send it to user, i tried to optimise it with ...
1
vote
2answers
91 views

Bash script (to be used as a login MOTD message) that displays status of docker-compose projects, and individual docker containers

This is for a cheap VPS I use for personal projects. I like having a message of the day displaying system info on login; I wanted to add the status of my docker containers to it, to see if all are ...
8
votes
7answers
2k views

Remove all unwanted characters from a string buffer, in-place

The following code was written with the intent to be as efficient as possible, where efficiency includes speed of execution, memory usage, and lines of code, all in support of the primary design ...
18
votes
2answers
3k views

Chess engine for C++

Basic Description What is the program for? This is just a hobby project for me to improve at coding, not a serious one. What does the program do? It can take a chess position (not including variations ...
6
votes
2answers
293 views

Python Place +,-, nothing between 1, 2, …, 9 (in this order) whose sum is 100

So this is a programming challenge I saw: Write a program that outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100. For example ...
0
votes
1answer
56 views

Enter the randomly displayed letter console game

The below code segments compose a simple console game where the user is prompted to enter a randomly generated letter displayed in the console. It also saves and loads user data through a .txt file. ...
0
votes
1answer
54 views

R code optimization

I have about 977 obs in top500Stocks which contains name of 977 stocks. ...
3
votes
2answers
123 views

CLI ASCII Maze Generator / Python 3.9

I made a maze generator in python that outputs in CLI. With mazes that are extremely big, it can take a while to output. I want to know if there is any way to increase the efficiency of this code. ...
1
vote
2answers
111 views

Find the 10001st prime number

Project Euler 7: What is the 10 001st prime number? I currently have this code: ...
2
votes
1answer
121 views

Brute Force Password Program / Python 3.9

I've been making a brute force program for fun. This program tries to guess a password using brute force. I've tried many things to help increase the efficiency. Here it is: (Sorry for the lack of ...
-1
votes
1answer
33 views

Displaying custom fields with values

How can I optimize and shorten this code that I am using to display Woocommerce custom fields? ...
3
votes
1answer
84 views

Archiving / Moving Data from one database server to another database server

I am working on an SMS marketing project based on Yii2 Framework (PHP 7.3 & MariaDb (innodb engine)) where we have to move the logs from different tables to the archive db, which is total a ...
2
votes
1answer
182 views

Alpha beta pruning with memorization (transposition tables) and bitboards (5x5 cumulative tic-tac-toe)

This is my first time trying solve a game using these techniques. I've looked at pseudocode of alpha-beta pruning with transposition tables and rewritten it in c++. ...
2
votes
1answer
74 views

How to increase the success rate of my Tic Tac Toe AI that uses the Minimax Algorithm?

this is my first post here! I am working on a Tic Tac Toe AI in Python that uses the Minimax Algorithm to beat either a computer or a normal player. As of now, It has approximately 70% chance of ...
2
votes
1answer
43 views

basic paging function, is there logical problems with the JavaScript part?

Basic paging function, is there logical problems with the JavaScript part? very basic paging function. I want to know if there are some problems in the logic of the code. I feel the JS code is a bit ...
0
votes
1answer
58 views

Optimizing location updates when adding a new object

I'm trying to keep a bunch of Objects called Machine in their proper order. I was wondering if it'd be possible to further optimize the function ...
4
votes
2answers
69 views

For each of the visitors, find if they were present within a time period: code is running slow

I'm working with a pandas dataframe which describes the start and end time of visits. A toy example of the data could be as follows: ...
3
votes
1answer
74 views

Python script that converts Windows Registry Scripts (.reg) into PowerShell scripts (.ps1)

Well this a re-implementation of a PowerShell script that I wrote which does exactly the same thing, and I have ported it into Python. After a quick Google search I found that there is only one other ...
3
votes
0answers
42 views

Extracting Korean text for sentiment analysis

It is quite long so I'm not sure I can ask you to review my code. But I have no choice indeed. What I'm doing is analyzing the Korean language. To do this, first I collect data and loaded the data via ...
4
votes
1answer
82 views

Dataframe transformation to numpy ndarray takes ages to complete

I would like to transform my dataframe into an array of fixed-sized chunks from each unique segment. Specifically, I would like to transform the ...
0
votes
0answers
42 views

How do I make my html object-to-table array script run faster? (Pandas)

I have a data frame that has several columns, one of which contains html objects (containing tables). I want a column of table arrays. My problem is that this piece of code takes a long time to run. ...
-2
votes
1answer
124 views

HackerRank frequency queries

need some help or advice, HackerRank's frequency-queries challenge, the challenge of this Hackerrank problem is to check if the frequencies of number in your data structure matches the queries. small ...
2
votes
1answer
31 views

Better way to structure and optimise try except statements

I am new to python and I am trying to write a function with various actions based on the parameters sent. I am checking if the data has valid format then it publishes to /accepted otherwise to /...
1
vote
1answer
77 views

The average amount of time required to travel between two points in a torus-like space

I have recently started to work with C++ and I do consider myself quite basic in C++ coding. I have made the following two functions and I was wondering whether someone could give me some hints on how ...
5
votes
0answers
97 views

Pi Calculator Using BBP (Bailey–Borwein–Plouffe) - Written in Cython With MPFR

I wrote a Pi Calculator using the BBP Algorithm in Cython. My specific goals are make the code more legible and more performant. This is a purely academic script in order to teach me how to implement ...
3
votes
1answer
81 views

Dice rolling program which also counts and stores the result

Is there any room for improvement, in terms of simplicity and efficiency? ...
0
votes
2answers
74 views

Improving Speed of VBA Code - Copy/paste two sets of variable, Excel does a calculation, returns a value then copy/paste the output value

I am attaching the code here. I am very new to VBA and trying to do a complex calculation using Macro. Please help me improve the speed of the attached code. The code works fine and produces the end ...
1
vote
0answers
35 views

81 variations of the rounded rectangle

If we apply outward curving, inward curving, and no curving at all, individually to each of the 4 corners of the rectangle, we get next 81 variations: The code implements next BASIC command: ...
1
vote
1answer
49 views

build a Xbonacci function that takes a signature of X elements ,each next element is the sum of the last X elements ,and returns the first n elements

this is a kata from codewars, here is the description of the kata: think of a Quadribonacci starting with a signature of 4 elements and each following element is the sum of the 4 previous, a ...
1
vote
1answer
546 views

Handling multiple optional parameters in Spring

I have an endpoint in my RestAPI which can receive 3 optional parameters and then find information in the database with these parameters, also it is possible to combine the parameters. So, in my ...
7
votes
1answer
69 views

Optimize K-Mean for large number of clusters

I am writing a Python code for KMeans clustering. The aim of this post is to find out how I can make my below mentioned code optimal when the number of clusters is very large. I am dealing with data ...
1
vote
1answer
25 views

Removing Loop from Numpy XOR

I have been playing around with numpy and matplotlib. My little project was to create a scatter plot ranging from -1 to 1 on both X and Y, but where the shading is done with the XOR scheme. The ...
0
votes
1answer
38 views

My code for a LocalBinaryPatern in python is running very slow. Any tips?

My code for a LocalBinaryPatern in python is running very slow. I tried optimizing it with tips from online. I'am still getting used to python, and programming in General so any tips are very welcome! ...
3
votes
1answer
59 views

Using Numba works slower than not using it for my Python code

I thought this community is better place to ask my question so I ask here rather than at StackOverflow. Recently, I learned that Numba can make Python function ...
2
votes
1answer
206 views

Project Euler Problem #755

As the title indicates this is one of the last most problems of Project Euler. The problem is straightforward. However, similar to the rest of the Euler Project problems either ...
0
votes
1answer
58 views

Watch for file changes in Linux

I have installed Geekworm x735 on my Raspberry Pi, it uses the script below with an infinite loop to determine if the power button has been pressed. I know there are some Linux utils that watch for ...
7
votes
2answers
186 views

Find the first repeating sequence in digits of pi

I wrote a function to return the first n length sequence which occurs twice in the digits of pi. Along with the repeated sequence, I want the indices of the first and second occurrences. For example, ...

1
5 6
7
8 9
168