Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
17 views

Inverse mapping with bilinear interpolation on an image

The following is my solution for an inverse mapping with bilinear interpolation on an image. The original image is img and ...
0
votes
1answer
18 views

Items and invoices query

I have invoices, invoices_items, order, order_items. <...
3
votes
2answers
30 views

Parsing Bitcoin binary data file with Python

The script parses Bitcoin database (blkXXXXX.dat) files directly from raw binary to txt human readable view. And I think about how to encrease the speed of processing. Can anyone suggest how to ...
1
vote
1answer
26 views

Creating folders even if already exist or removing removing their content

I have a project where, every time I run it, I have to: test if some folders exist, and create them if they don't exists. remove their content if the folders already exist. This is the code that I ...
3
votes
3answers
107 views

Image filter for gradient detection

This filter is basically gradient detection (the variable gradImg) like an edge detection (Sobel or Prewitt filters) and also the direction of that gradient whether ...
5
votes
1answer
57 views

Linear regression on points specified by the user in a GUI

Here's my take on the Linear Regression exercise from John Zelle's Python book. Open a window, let the user click on as many points as they want. Upon pressing the "Done" button the regression line ...
2
votes
1answer
18 views

C Recursive Opendir Wrapper to Sort Directories First (ascending/descending)

A recent post on StackOverflow about a recursive directory listing which produced an unsorted mixed file/directory list, sparked the stray thought of "What would it take to write a wrapper for the ...
2
votes
1answer
44 views

Fast Factorisation (Python Implementation)

An algorithm for finding prime factors of a number given a list of all primes up to the square root of the number. It's worst case time complexity is \$O(n^{1/2})\$, the best case would be \$O(\log(n))...
0
votes
1answer
50 views

Fast Prime Sieve (Python Implementation)

A modified version of the prime sieve. I actually doubt it could be implemented any faster, but I might be wrong: ...
1
vote
0answers
45 views

Optimize Application of Python Gensim Search Functions

I have a DataFrame that has a text column. I am splitting the DataFrame into two parts based on the value in another column. One of those parts is indexed into a gensim similarity model. The other ...
3
votes
0answers
24 views

Export EXIF data from thousands of images to CSV

I have written a script that retrieves specific fields of Exif data from thousands of images in a directory (including subdirectories) and saves the info to a csv file: ...
10
votes
3answers
3k views

Goldbach's conjecture algorithm

I did a Goldbach's Conjecture exercise and got it to work. It's pretty slow though and I was wondering how I could optimize it. ...
2
votes
2answers
47 views

Chained Sort Python Implementation

So I've run into a few occasions where I'd want to sort a list according to a criteria, then for all loosely sorted sublists (a sequence of equal elements), I'd want to sort those sublists according ...
5
votes
2answers
408 views

Python update SQLite DB Values

At the moment I try to get used to SQLite and Python. I started with insert, select and so on. But now i want to get a bit further. Now I have a DB with 200 rows for testing and in want to update two ...
0
votes
0answers
13 views

QTP/UFT Prints the time in takes to complete every task in a Log using VBScript

This script is meant to log the time it takes to complete functions in order to find the locations where performance could be improved in QTP. If a duplicate log is attempted, the script changes the ...
0
votes
0answers
81 views

Voxel Engine with Vulkan

Here is my voxel engine. I want some review for performance on the renderer. What can be improved? What must change? Also I'm not sure it is efficient to use vkWaitQueueIdle for syncing. The end goal ...
1
vote
0answers
43 views

Snake animation in Swing

I'm developing a simple Snake game in Java using Swing. So far I made the snake animation which is troubling me: when the snakes moves it seems like it starts to lag for no reason, but when I move it ...
2
votes
2answers
58 views

JavaScript flood fill

I tried to implement a very simple color flood fill to experiment a bit with Javascript. All comments about the code are welcome but I am especially interested in performance as it seems to be a bit ...
0
votes
0answers
42 views

Parse tokens into statements for compiling efficiently [on hold]

You can see the code here on GitHub but I am going to ask about one part, and that is the makeExpression function. ...
1
vote
4answers
135 views

Calculate probability of dice total

I am working on a project to get dice probability that requires 4 decimals places. My code works great, until the dice become huge (as I use in the example below). I am wondering if there is a way to ...
2
votes
1answer
47 views

Locate substrings within a file

Here, I am reading in a newline delimited file that can be millions of repeating lines that looks like this: ...
4
votes
0answers
153 views

The process to calculate the Levenshtien distance of each element of a large data set with every other element of another larger data set

I am currently working on a problem to find the best matches of data in a List namely "ListA" from another List called "ListB". Whenever I find a match of an element for "ListA" with any element in "...
5
votes
1answer
233 views

Count pairs in list of integers such that their addition is equal to the input value

Given a List<int>, the problem I am trying to solve is: Find the number of unique pairs in List<int> such that their ...
0
votes
0answers
39 views

Golang message bus for a game engine

I wrote a memory bus struct in golang to allow systems to interact with each other without knowing anything about the receiver. This is for a game engine. I know it's not good to write games in ...
6
votes
3answers
228 views

Encoding 0/1 bits to 0/255 bytes in C++

I need to map a sequence of bits that represents a float into a sequence of bytes by this rule: the value 1 maps to the value 255 and the value 0 maps to the value 0. This is the code I have now: <...
0
votes
2answers
39 views

Fastest way to retrieve information from array and display in html

I am creating an app in html5 for mobile, and I have all the information of the items inside an array with 887 entries. Each entry have 32 key with values, some with more than one value. I am using a ...
3
votes
1answer
78 views

Circuit builder that calculates resistance/current/voltage

I am somewhat new to programming. I've written a program that takes user input accepting voltages and resistors, and calculating total resistance/current/voltage in the circuit. I am looking for ways ...
3
votes
2answers
63 views

Finding the number of integers between 1 and K, who's sum of the digits is a multiple of D

Good day. So, I need to find the number of integers between 1 and K (inclusive) satisfying the following condition, modulo (10^9)+7: The sum of the digits in base ten is a multiple of D Here is my ...
3
votes
0answers
25 views

Select polygons that overlap with other polygons within a single feature class

I am running a script to identify polygons that overlap with other polygons within the same layer. I have managed to do this with the code below but the problem is that it is very slow (about 3 ...
2
votes
1answer
35 views

Batch downloading to file or memory

This is likely my first useful piece of Rust code. Planning to crate-ify it. It works. ...
1
vote
0answers
44 views

LSB Image Steganography

After learning the concept of steganography, I've decided to code an application for it in PHP out of all languages, using the Least Significant Bit technique. A pixel of a colored image generally ...
0
votes
1answer
34 views

Computing a prime table in Rust

My objective is computing a table of primes up to n, where n is a natural number passed as an argument to the prime_table function. Here is src/lib.rs: ...
6
votes
1answer
93 views

Chess engine programmed in Python

I programmed a chess AI in Python. It uses the alpha-beta algorithm with move ordering. I want it to be able to look further than depth 4, without increasing calculation time. I am wondering how I ...
2
votes
2answers
74 views

Number of anagrams in an array of words (Codewars)

Codewars Kata in Question. An anagram is a word, a phrase, or a sentence formed from another by rearranging its letters. An example of this is "angel", which is an anagram of "glean". ...
3
votes
1answer
44 views

Reading releases details from github and writing to google sheet file

I am a beginner Python developer and I wrote a python script which reads releases data from Github for a specific release of a repository and write those release details to a specific file in google ...
1
vote
2answers
54 views

Recursive Transversal (Python)

For a programming challenge I was doing, I needed to traverse a list of lists, and while writing the standard 2D traversal function, I thought why not generalise it, so I did. Here's my best effort: ...
3
votes
0answers
11 views

IDL code for minimum distance calculation

I made a program in IDL for performing a minimum distance classification on multispectral satellite data. This is what my main function looks like ...
-3
votes
1answer
42 views

About the problem of seeking matrix inverse

Recently I have solved the inverse matrix in three ways, found that their work efficiency has obvious differences. This is the case: ...
3
votes
1answer
39 views

Extended Binary Search Function (python)

I wrote a function to find the closest value in a list to a given search value. What prompted me to write it was as boilerplate for a prime number problem so I could find the closest prime to a given ...
6
votes
1answer
70 views

Identify Duplicate Files

A friend of mine has the following issue. He has a nearly-full 1TB hard drive on which he keeps copies of all the pictures from his digital camera(s). However, he knows that he has copied the entire ...
6
votes
1answer
99 views

Trimming blank space from images

I am working on scanned documents (ID card, Driver licenses, ...). The problem I faced while I apply some preprocessing on them is that the documents occupy just a small area of the image, all the ...
1
vote
1answer
43 views

Combine data from a list and map based on criteria

I am using Java 8. I want to build a final list using following data. All objects in basicData list must be added to final list. But if there is a matching object based on matching key from modData ...
2
votes
1answer
50 views

Tip Calculator in pure JS

A simple tip calculator that asks for the total bill amount, service quality (used to determine what percentage of the total cost will be tipped), and how many people are sharing the bill (used to ...
1
vote
2answers
124 views

Faster code for leetcode reverse int

This is my solution for the leetcode reverse int question: Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 ...
2
votes
1answer
73 views

Making a catalog of pictures

Is there a way to make this code run faster? I have over 6000 pictures in .jpg optimized to a maximum of 40 kB. It starts quickly but after like 2000 pictures it runs way slower. The final .xlsm file ...
2
votes
2answers
71 views

Application to monitor device power levels for deviations

I have a high performance, computation intensive application that runs on a Centos 7 machine with Python 2.7.5. I'll try to explain what the application does: The application runs an infinite loop, ...
0
votes
1answer
44 views

On form inputs focus, show div. hide div on blur for multiple inputs and hidden divs

I posted a question on Stack Overflow and got an answer that works but has a lot of duplicated code. In the future, the functionality may also require a third or more divs to be shown or hidden. The ...
1
vote
2answers
52 views

Pygame simulation of a production line

So my code works as intended, but suffers major performance issues every time I add a new object to the screen. The speed of my objects basically gets cut in half. All you have to do to observe this ...
2
votes
0answers
34 views

Extracting face features from selfies faster

My code takes two .jpg files (two selfies) and extracts a vector of 128 features from each selfie. After this extraction we take these two vectors and get their cosine distance. I timed the script ...
2
votes
0answers
26 views

Solving the wooden snake chain puzzle

My code tries to solve the wooden snake chain puzzle: I do so by generating all possible link configurations which are then tested. I was hoping that laziness would take care of the very many ...