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.
679
questions with no upvoted or accepted answers
30
votes
0
answers
750
views
Definitional Returns. Solved. Mostly
I have made the bold claim that a longstanding problem in Rebol is "now solved"...that of "definitional returns".
But of course, such claims need some peer review, and there's always some new trick ...
23
votes
0
answers
573
views
Multiplying big numbers using Karatsuba's method
The Karatsuba algorithm, first published in 1962, aims to speed up the multiplication of big numbers by reducing the number of 'single-digit-multiplications' involved.
Because of its complexity (...
9
votes
1
answer
1k
views
Function that recursively downloads entire directory is slow
I created this function to recursively copy an entire directory from an FTP server. It works just fine except that it is about 4 times slower than using FileZilla to do the same operation. It takes ...
7
votes
0
answers
102
views
Frequency analysis for simultaneous dice rolls
My professor told me to optimize my perl code, but he wouldn't tell me what exactly - just make it simpler.
I changed some little things but nothing major. Am I missing something?
The task was:
...
7
votes
0
answers
731
views
Unity3D shader for rendering 2D sprites with a pseudo-glitch effect
I'm making a puzzle game in Unity with sprite-based graphics. When the game is paused, I want to hide most game elements, because I don't want the player to be able to pause and leisurely think about ...
7
votes
0
answers
154
views
Modeling tabular structure in MSSQL to store data like Excel sheet applying Column inheritance
I've created this database structure to store tabular information (it's a simplification of my real structure but enough to show the point). In it I have Sheets and ...
7
votes
0
answers
105
views
Perl gradient noise generator
I'm working on 2-D top-down graphics engine, and need a way to simulate clouds. My idea was that I could create a layer comprised of a matrix of rectangles whose alpha value would be picked from a ...
7
votes
0
answers
117
views
Stable variation of built-in sort
Ruby's built-in sorts are unstable. The stable_sort gem monkey-patches Ruby's built-in library to have stable sorts which include nearly all the functionality of the built-in sorts, but with the ...
7
votes
0
answers
546
views
Red-black tree appears to be slower than std::multimap
I've written a red-black tree in C as an exercise. The tree works and it is not bad, but it is about 10% slower than std::multimap from libstdc++ which I'm ...
6
votes
0
answers
391
views
C# Generic high performance vectorized math operations
I'm writing a library which simplifies the usage of intrinsics in C#.
It's a generic library which supports all numeric types.
The goal of this library is to perform these operations at the highest ...
6
votes
0
answers
277
views
Chart Based Animations In Excel VBA
I've been working on re-writing comfortablydrei's answer to this PPCG Question regarding creating a illusion animation in pure Excel VBA. So far, I've been able to rewrite the code to function in VBA, ...
6
votes
0
answers
141
views
Julia set in Julia (and other fractals)
I've made the following to draw a series of zooming in images of a fractal.
...
6
votes
0
answers
143
views
How to speed up simple linear algebra optimization probelm in Julia?
I implemented the LSDD changepoint detection method decribed in [1] in Julia, to see if I could make it faster than the existing python implementation [2], which is based on a grid search that looks ...
6
votes
0
answers
261
views
Generating integer partitions
I've tried to implement integer partition algorithm as described in blogpost below (author implemented it in Python):
Generating integer partitions
I'm still trying to learn best practices in ...
6
votes
0
answers
116
views
Android component animatable on its height
I'd like to have a code review for a component which is supposed to be animatable on its height. It's supposed to be a transitioning element.
I find it quite laggy on my phone.
...
6
votes
0
answers
777
views
Pseudo-parallel depth-first search
I'm writing a small program that generates a file containing an adjancency matrix, it then reads from that file, constructs a graph and does something like a parallel depth-first search (dfs) on it.
...
6
votes
0
answers
848
views
Parsing Lua 5.2 strings with patterns
I wrote some code to parse Lua 5.2 strings in Lua 5.1, using patterns. It works perfectly as far as I tested.
...
6
votes
0
answers
605
views
Fowler–Noll–Vo hash function in Lua
I recently coded this FNV-1a hash function in Lua. Are there any apparent performance improvements that could be implemented?
...
6
votes
0
answers
421
views
Translating CFRM algorithm from Java to Clojure and improving performance
Counterfactual Regret Minimization is an algorithm that can be used to find the Nash Equilibrium for games of incomplete information. I have tried to adapt the exercise from here to Clojure. You can ...
6
votes
0
answers
444
views
Implementing recursive filters with Haskell/Repa
I recently learned Haskell, and I am trying to apply it to the code I use in order to get a feeling for the language.
I really like the Repa library since I manipulate a lot of multi-dimensional data....
5
votes
0
answers
634
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 ...
5
votes
0
answers
222
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 ...
5
votes
0
answers
266
views
Optimizing bit-matching performance using AVX compiler intrinsic
We are working on a complicated math problem, very detailed question with description of the problem is here: C++ multi-threaded determination of curling numbers in vectors.
That code is now converted ...
5
votes
0
answers
74
views
Small Automatic Differentiation Library
Introduction
As a programming exercise I recently wrote this automatic differentiation library based on forward accumulation. It should offer a simple way to create mathematical functions whose ...
5
votes
0
answers
1k
views
Extract data from API using VBA & XML (Performance)
EDIT: Added a block with the raw code at the bottom (suggested by a friendly user)
First post here. I sincerely hope that I am doing everything by the book. Also, I want to thank you in advance for ...
5
votes
0
answers
101
views
4×4 cofactor in SSE
The cofactor of a 4×4 matrix can be used to convert a "regular geometry" matrix into the matrix that transforms the normals. It's an alternative to the common inverse-transpose pattern. In this post I ...
5
votes
0
answers
61
views
Tensorflow loop to analyze gradients derived from MRI and PET images
The code shown below takes the partial derivative of each pixel of the output fused image of a neural network with respect to input image of the neural network using tensorflow's ...
5
votes
0
answers
175
views
Fast Hardy-Weinberg equilibrium simulation
I was very bored over one of my breaks this year, so I built a Hardy-Weinberg equilibrium simulator for two unrelated alleles of the same gene. Hardy-Weinberg equilibrium is when there is no evolution,...
5
votes
0
answers
896
views
Uploading captured video to Google Cloud Storage
My program intends to capture video streams (in mjpeg) with OpenCV and upload the captured frames into Google Cloud Storage for later processing. I am expecting to capture ~15-20 frames per second and ...
5
votes
0
answers
378
views
Optimizing Graph Algorithms for Floyd Warshall and Johnson Algorithm
I am trying to implement and compare Floyd Warshall and Johnson Algorithm(for Sparse Graphs). I have written the following code which produces correct output values for the all pair shortest paths. ...
5
votes
0
answers
229
views
Speeding up the implementation of Stochastic Gradient Ascent in Python
I am implementing a time-dependent Recommender System which applies BPR (Bayesian Personalized Ranking), where Stochastic Gradient Ascent is used to learn the parameters of the model. Such that, one ...
5
votes
0
answers
1k
views
Python code to calculate STM CRC32
I have code to calculate STM CRC32 in python. It works well but I'm shocked from time when I see how much it takes. Namely calculating for 5120 bytes takes about 20ms (or even more)! Now I'm thinking ...
5
votes
0
answers
199
views
WebPage LogReader class - Parallel DNS w/timeout for computer IP's and domains from log scrape
This is a namespace to read a bunch of events from a log file and display them in a table on a webpage, some additional data (computer domain and IP address) is also pulled in from DNS. I am mostly ...
5
votes
0
answers
66
views
Building a form for rebooting many network devices
I have several IP based devices that, due to building maintenance, occasionally lose their communication with the other devices. Normally you'd have to find the device IP, go to its control page and ...
5
votes
0
answers
69
views
Simulation of a mechanical arm
The code that I am doing is to simulate a scenario where a mechanical arm search pieces closer and these pieces selected the mechanical arm leaves in a position defined closer.
...
5
votes
0
answers
147
views
Simple HTTP router package
I have created a router/micro-framework. I have split my code into multiple files by responsibility. All files are in the same directory. Would you recommend any way of improving it ? The most ...
5
votes
0
answers
176
views
Assembling and traversing a graph, given a list of items and parent pointers
I've written a function which takes input such as this:
...
5
votes
0
answers
169
views
Kernel density regression in Julia
Here is a naive implementation of a kernel density regression algorithm in Julia.
The code works, but there is quite a bit of room for improvement though. First, there is not an optimal bandwidth ...
5
votes
0
answers
446
views
Persistent segment tree
I'm trying to solve this problem.
Given a sequence \$B=B_0,B_1,\ldots,B_{N−1}\$
for each query \$(P,K)\$, find the minimum \$S\$
s.t. there are at least \$K\$ entries in \$B\$ that satisfies
...
5
votes
1
answer
944
views
SortedList performance
I've found my app, which uses the SortedList, has a poor performance.
So I decided to try to improve the performance of my app.
I created the ...
4
votes
0
answers
150
views
Optimizing a Wordle Solver in JavaScript
I have written a Wordle solver in JavaScript.
The solver generates a decision tree. For each word, it generates all possible feedbacks patterns for that word, it then selects for each pattern the word ...
4
votes
0
answers
262
views
Solar System simulation with real values in pygame
Inspired by TechWithTim, I built up the solar system including Pluto. I have added a camera feature, zoom feature and displaying information about the selected planet.
Zoom in and out using arrow keys,...
4
votes
0
answers
139
views
Simple Leaky Bucket Async and Low Footprint
I'm working on a simple Leaky Bucket algorithm.
I have found a lot of samples on the internet, but something always bothers me.
Most of them use Collections and DateTime to track current actions and ...
4
votes
0
answers
111
views
Word finder using pygame
I made a word searching app that allows the user to inout words into a text box,
and parts of the word grid will be highlighted to show the location of the words.
The letters of the grid can be edited ...
4
votes
0
answers
478
views
Simple chess engine in Python
I have programmed a chess AI in python as a first project to learn both Python and the inner workings of a chess engine and wanted to have some input on syntax, code efficiency and any tips in general ...
4
votes
0
answers
89
views
Reduce size of minesweeper program to fit in qr code
I saw a guy who fit snake in a qr code and I wanted to do the same thing but with minesweeper. The maximum amount of data a qr code can hold is 3kb. My c program, without any compiler magic, takes up ...
4
votes
0
answers
37
views
Rearranging data from one table to another in spreadsheets using apps script
I need some help with making my code run faster. It currently works by going through all cells in a 201x151 table. If the value in a cell is not equal to zero, then it will return the row number, the ...
4
votes
0
answers
81
views
Fast compression using a thread pool
This is my latest effort on RFC 1951 compression ( the widely-supported compression standard ) in Rust. It uses 2 extra threads to compute the LZ77 matches and the checksum in parallel with the ...
4
votes
0
answers
108
views
Naive Solver of Matrix with Periodic Boundary Conditions Feedback
I am creating an \$O(n)\$ solver for an \$Ax = b\$ system where \$A\$ has the form
\$
A = \begin{pmatrix}
a_1 & b_1 &&&d_{u}\\ c_1 & a_2 & b_2\\& \ddots & \ddots &...