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.

657 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
25
votes
0answers
504 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 ...
13
votes
0answers
164 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 (...
11
votes
0answers
126 views

Delete engine for deeply nested linked structure

The background is the question at https://stackoverflow.com/questions/36634394/nested-shared-ptr-destruction-causes-stack-overflow. To summarize, for a data structure that looks like: ...
9
votes
0answers
873 views

Bilinear interpolation using Neon intrinsics

I'm trying to do a Bilinear interpolation on the ARM Neon. However, I find that my vectorized code is slower than the regular one, on a BeagleBone Black. Any idea why this could happen? I'm using ...
8
votes
0answers
168 views

Population dynamic simulation on biological information maintenance 2

This question is the follow-up to this previous question. Background Using this simulation I investigate a system in which enzymes proliferate in cells. During the replications of enzymes, ...
8
votes
0answers
304 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 ...
8
votes
1answer
614 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
0answers
84 views

Neural Network with Template Metaprogramming

I was implementing a simple neural network, and I noticed that, if I ever wanted to change the layers' activation functions, i would have had to completely rewrite some parts of the code, so I tried ...
7
votes
0answers
79 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
0answers
131 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
0answers
685 views

Read quantization tables from JPEG files

I'm developing an application that will hide information inside the quantization tables of JPEG files. It's called DQTsteg, if you want to know more about what I'm attempting to do. Right now I'm ...
7
votes
0answers
88 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 ...
6
votes
0answers
75 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
1answer
65 views

Ternary Search Tree / N-Gram Model in Python

I implemented a word n-gram model using a character ternary search tree. It is intended to be passed a generator that yields a long sequence of words (from a corpus) and its requirements are that it ...
6
votes
0answers
55 views

Reading sparse matrix from binary file

I have binary files containing sparse matrices. Their format is: number of rows int length of a row int column index int value float Reading ...
6
votes
0answers
75 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 ...
6
votes
0answers
83 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
0answers
2k views

Calculating T-Test within Large Pandas Dataframes

The below code runs a t-statistic within a large dataframe (rnadf) based on masked values from another dataframe (cnvdf_maked). ...
6
votes
0answers
487 views

Gauss-Seidel+SOR

I am learning OpenMP+MPI hybrid programming. As an example I have chosen Gauss-Seidel+SOR. My implementation uses MPI_THREAD_FUNNELED style hybrid programming, ...
6
votes
0answers
706 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
0answers
328 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
0answers
385 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
0answers
407 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
0answers
73 views

A straightforward method for computing the Binomial probability mass function

I've been writing up code to test an alternate way of calculating the Binomial probability mass function. The Binomial random variable is the number of heads out of N coin tosses with coins that have ...
5
votes
0answers
45 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
0answers
150 views

Spliting PDF and get thumbnail while adding it to a ListView

I'm doing a application to work with PDF and TIFF files. To divide them, the user opens the file or folder (if it is a folder, it gets all the files inside) and the app splits the file, getting a tiny ...
5
votes
1answer
234 views

Converting Reverse Polish to Infix Notation in Java

I am trying to solve a programming challange that involves converting reverse polish notation to infix notation. For example: 1 3 + 2 4 5 - + / would be: ((1+3)/(2+(4-5))) My solution so far does work,...
5
votes
0answers
419 views

Asyncio HTTP Request Queue

I wrote a simple sitemap.xml checker using asyncio and aiohttp. I followed the documentation demonstrating the producer/consumer pattern. However, I noticed that as the URLs scale larger, it seems to ...
5
votes
0answers
465 views

Codewars: N-dimensional Von Neumann Neighborhood in a matrix

Task: For creating this challenge on Codewars I need a very performant function that calculates Von Neumann Neighborhood in a N-dimensional array. This function will be called about 2000 times The ...
5
votes
0answers
162 views

A* algorithm optimization and implementation

I am implementing the A* algorithm in Python and have successfully completed the task. It works and even spits out the coordinates from the start to the end. However, I am programming a bot for a ...
5
votes
0answers
65 views

Comparing the size of tumors over time using PANDAS

I have a dataframe in pandas like this ...
5
votes
0answers
177 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
0answers
57 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
0answers
64 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
1answer
159 views

Hoc462 - A Raycaster

For the past week, I've been making a raycaster in JS and if you want a live demo, you can try it here. It ran smoothly before I added variable height walls but now it is very slow (~15 FPS) so I want ...
5
votes
0answers
323 views

Object-oriented fractal tree

I made an object oriented fractal tree in javascript using the p5 library, it consists of three files: Fraternal Tree.js branch.js flower.js Here is the github repo with the source code. All the ...
5
votes
0answers
153 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
0answers
520 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 dfs on it. How can I make the ...
5
votes
0answers
206 views

Median filter for large mask

I'm trying to implement the fast median filter developed by T.S.Huang (HUANG, T.S. 1981. Two-Dimensional Signal Processing II: Transforms and Median Filters. Berlin: Springer-Verlag, pp. 209-211.). ...
5
votes
0answers
637 views

Multiple 0-1 knapsack

I have a problem were the time in minutes of N songs are given and I have to write the maximum number of time in K CDs. Input description The first input line consists of two positive integers N e ...
5
votes
0answers
407 views

Specialty tree structure - BK Tree

I've been working on a implementation of specialty tree structure called a BK-Tree (more here and here). Basically, it's a tree that allows relatively efficient querying for items within a specific ...
5
votes
0answers
129 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
0answers
2k views

Web scraping from the Google Play store

I am using this R function to web scrape data from the google play store. Is there a way to increase its efficiency using R? This code takes about 4 seconds for 14 urls with my machine/internet ...
5
votes
0answers
375 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 ...
4
votes
0answers
57 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 ...
4
votes
0answers
55 views

Julia set in Julia (and other fractals)

I've made the following to draw a series of zooming in images of a fractal. ...
4
votes
0answers
36 views

Border Radius Preview Tool

I am running through an app idea to help improve my knowledge of Javascript. The code attached performs the following: Performs a regex on the input field to check it is value 0-9 If not, it clears ...
4
votes
1answer
52 views

Evaluator for adding and subtracting algebraic expressions

I wrote a little program that adds and subtracts some algebraic expressions. In my code (2 x 3) represents \$2x^3\$. The purpose of this post is to get some ...
4
votes
0answers
230 views

Wait free triple buffer primitive

I'm trying to write a triple buffer that's wait free for a update + render loop after being bitten by lock starvation one too many times (on a different project, using a library). For reference, a ...