Tagged Questions
Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.
2
votes
1answer
28 views
Loading and comparing files containing 3D data
I have written a program to compare two 3D raw data equal or different. But I think the time consuming would be reduced if I use the STL. How to improve the program? The complete and varifiable code ...
3
votes
0answers
29 views
Scrolling 2D Tiles
update:
So, this is weird, I just reinstalled Adobe Animate, and now, when I do ctrl+enter (test movie), it pulls up an AIR window, and plays my app, and it works smooth as butter! (now I'm just not ...
1
vote
1answer
58 views
Image processing for black level and lens shading correction
I don't have a lot of experience in C++; I'm more of a C# guy. I'm trying to convert some Matlab image processing code to C++. I would appreciate any feedback about C++ coding conventions, which data ...
1
vote
2answers
36 views
Finding the first two numbers that sum to a given number [duplicate]
Task aim: Given a list of integers and a single sum value, return the first two values (parse from the left please) in order of
appearance that add up to form the sum.
I've been trying to make my ...
5
votes
1answer
21 views
Slicing Stack Exchange data dump XML files into small bites
I was posed with a challenge when trying to load XML files from Stack Exchange into a SQL Server database; some of these XML files are extremely large (largest one being a whopping 67 GB in a single ...
3
votes
1answer
64 views
K-means clustering implemented in Python 3
Here is the classic K-means clustering algorithm implemented in python 3. My main concern is time/memory efficiency and if there are version specific idioms that i could use to address issues of the ...
5
votes
1answer
37 views
Monte-Carlo method to estimate Pi runs slower in multiple threads, than in single thread
I'm learning Scala, and I wrote a program to estimate the value of Pi. When I'm using multiple threads, it takes 5-6 times longer to calculate the same iterations. I wrote a similar program in Java, ...
2
votes
1answer
27 views
python text cutting tools for twitter
A few days ago I wanted to build a tools to cut a long text into one hundred-letters strings with the number of the tweets and also which part of the tweets, the tweet belongs to
...
0
votes
1answer
13 views
Correlated subquery slow
I have a table that looks like this
Directory nvarchar(max)
Extension nvarchar(10)
Length bigint
I also have another table that provides the type of file (lookup table)
extension nvarchar(10)
...
0
votes
1answer
14 views
Optimize hash OCaml
I am running a simple OCaml program which opens a CSV file with a pseudo dict-reader and hashes "key" + "value" (where key and values are strings). Then some counts are evaluated on the hashes (but it ...
5
votes
0answers
17 views
Haskell tool for find @SuppressWarnings in Java source code
I put together a little tool for finding where people have suppressed warnings, and to see if they have commented why. Its in Haskell for fun and some practice. Its split into two files, the thinking ...
2
votes
0answers
19 views
Saving data to a Sharepoint list taking a long time
I inherited this code that saves data to a sharepoint list.
This method saves the data to the list.
In other parts of the application a list is presented and can be paged through.
You then select an ...
1
vote
1answer
98 views
Iterate over million points to get unique closest point
Let's say we've two parallel galaxies with same amount of stars. What I want to do is to find the nearest neighbour of GalaxyA in GalaxyB. But if that particular neighbour is shared by other star(...
4
votes
0answers
86 views
+100
Improving speed of copying directories in windows
I wrote a program to copy directories in windows 10 operating system. I have tested copying a directory(696MB) in 3 different ways:
xcopy: time taken - 52 seconds
ctrl + c : time taken - 78 seconds
...
0
votes
1answer
26 views
Project Euler #1 in Go (counting multiples of 3 or 5 up to 1000)
I've been working on Project Euler, here was my solution for Problem #1. It gave me the proper answer, but it's egregiously slow. How can I implement this more efficiently? My math skills aren't top-...
1
vote
0answers
24 views
Node Automation Project - Unit Testing, Possible Issues, Standards
Info
I usually do automation and integration testing with Selenium but have heard good things about some of the Node headless frameworks. So I put this project together to get some experience with ...
2
votes
2answers
43 views
Base 10 to Base N conversion
Before I begin using this code in vital systems, I wanted to quadruple-check that it was soundproof. I plan to implement this as part of a larger program, obviously not by itself. Are there any clear ...
4
votes
2answers
48 views
Search for variants of keywords using LINQ
First, I'm adding words entered into a search field to an array. Then, I'm getting results from a stored procedure on SQL Server using Database First approach with Entity Framework.
Finally, for ...
6
votes
2answers
67 views
Find and copy pasting optimisation
I am trying to apply this simple macro to merge two big sized sheets (around 30000 rows each), but the process is too slow and never ends. The macro works perfectly with smaller sheets. Could you give ...
0
votes
1answer
38 views
5 input based search form for Android
I've been trying to look for a better way in which a user has up to 5 inputs in which they can search for results in a database.
I have 2 EditTexts in which the ...
2
votes
0answers
62 views
measuring the time taken to copy a std stl container
I'm trying to measure the time taken to copy a std::vector<someObject>. Would like to know if this is a correct approach. I tried to do some trivial ...
3
votes
1answer
136 views
3
votes
1answer
30 views
Making a string by reading down a matrix
Suppose I have a string with a length always a multiple of four:
'CodeReviewSE'
My goal is to create a permutation. First, I arrange the string into a matrix (...
3
votes
2answers
53 views
Functional Conway's Game of Life in JavaScript
In this code, I tried to integrate my little knowledge of(and great fascination towards) functional programming. I'd like to make this code more functional, and faster, if that's possible.
...
2
votes
1answer
71 views
Pixelate image with average cell color
I wrote a function that will pixelate an image using the average color of each 4x4 cell.
The function will "split" the image into 4x4 cells, and find the average color of each pixel in the 4x4 cell, ...
1
vote
1answer
41 views
Gabor filter implementation
I have implemented the Gabor Filter of which I provided the source code as bellow.
The code is deadly slow.
Applying the filter on a grayscale image of Lena 512x<...
4
votes
1answer
31 views
Rotating list in python
This is a list class which allows users to "turn" the list while keeping track of the current position.
For efficiency, the list is not actually rotated on each rotation, but instead an offset keeps ...
4
votes
2answers
52 views
X12 Reader (C#) Performance
Is there any way that I can improve the performance of my x12_reader? The main functions that seem to be the bottlenecks are ...
7
votes
0answers
26 views
Load and Parse Stack Exchange data dump XML into DB table
I have put together a stored procedure to load and parse the Stack Exchange Data Dump into a relational database (akin to Stack Exchange Data Explorer). Each site has 8 XML files like these:
The ...
-1
votes
1answer
76 views
Can I make this C# code any faster? [closed]
Is there any way that I can make these two functions faster. I call these functions millions of times from my application.
...
4
votes
1answer
29 views
Round Two: File hash sum generator in Python
This is a follow-up review request to the first one for this same utility/file/script. The first review can be found here: Cross-platform file hash sum generator in Python
I'm back with the ...
7
votes
2answers
59 views
Parametrization of a curve
For a set of 2D or 3D points \$\{\mathbf P_0, \mathbf P_1,\cdots,\mathbf P_n\}\$, their parameters \$\mathbf T = \{t_0,t_1,\cdots,t_n \}\$ could be computed as follow:
$$\begin{align}
t_0&=0\\
...
-2
votes
0answers
21 views
OutOfMemoryError crash on MQTT Push service [closed]
Hi i am getting OutOfMemoryError crash reported in GA. I have implemented Push notification service using MQTT by referring following example https://github.com/tokudu/AndroidPushNotificationsDemo ...
7
votes
0answers
97 views
Fast bicubic upscaling in C# for image scaling
I've been trying to write an image scaler in C# with a focus on improved performance over the GDI+ scaler.
My current bicubic implementation when running with a single thread is slightly slower than ...
2
votes
2answers
71 views
Calculating the statistical Mode(s) of a (possibly multi-modal) set of elements
I am trying to come up with the most performant way of calculating the statistical Modes of a std::vector, obeying two conditions:
1) my function should not ...
13
votes
4answers
2k views
Determining if the kangaroos will land in the same position
Problem
There are two kangaroos on an x-axis ready to jump in the positive
direction (i.e, toward positive infinity). The first kangaroo starts
at location x1 and moves at a rate of v1 meters ...
7
votes
6answers
1k views
Yet another Fibonacci number generator
First attempt at dynamic programming. I want to make this run faster and better.
fibonacci.cpp
...
3
votes
0answers
31 views
Data conversion routines for FFT
I have written the following routines to work with digital images in various representations.
Can I optimize them for better accuracy and performance?
...
2
votes
1answer
28 views
FFT Convolution
I have written the following routines to convolve two images in the frequency domain which are represented as 2d Complex arrays.
How can I optimize my routines for better performance?
...
0
votes
1answer
78 views
Determining possible moves in a Chess game
I'm making a chess engine that is going to run the function containing this loop many times a second, so I want it to be well optimized.
Which of these two implementations would perform faster?
This:...
2
votes
1answer
47 views
Filesystem search class in C#
Anyone can tell how to make this code faster?
This search takes too much time... 700 000 files for 15 minutes...
I will be grateful for each micro optimization!
Search Class:
...
1
vote
1answer
44 views
Project Euler #4 - finding the largest palindrome from the product of two n-digit numbers
The code works well enough until trying to find the largest palindrome of two eight digit numbers. I found a similar question in C++, but there are some differences:
The main function takes two ...
0
votes
1answer
49 views
Grammar lexer in C++
Here is a lexer for a grammar I'm designing. After benchmarking with 1MB files and having several iterations of the lexer, I found that coping the file being read into a buffer and lexing that buffer ...
0
votes
1answer
34 views
Web crawler that uses Task Parallel Library
This is the first time using the Task Parallel Library and it seems to be performing much slower than I was expecting. The application is simply a web crawler that returns all URLs for a given URL.
...
4
votes
2answers
72 views
Getting NTFS permissions of all shared folders on the local machine
How can I improve the speed of the script?
...
-2
votes
1answer
50 views
Updating contacts in mobile phone simulation
I'm currently making a mobile phone simulation, using a custom object in an ArrayList. I was wondering if there was any difference in using these two following ...
-1
votes
1answer
99 views
0
votes
2answers
31 views
Conditionally creating new variables for data manipulation
My problem is related to data manipulation: on the basis of the existing variables in a given data set, I would like to create new ones. Bonus points for performance as well as code readability.
Let'...
0
votes
0answers
18 views
Speedup Django model
My goal is to calculate the discount price dynamically.
I have two models: Product and Sales.
...
0
votes
2answers
46 views
Searching local drive for multiple files
Well, I'm writing a piece of code that will take a list of file names and should search a local drive for each file, determine if it's there or not, and return an array of all the paths found.
Right ...