Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.
3
votes
1answer
56 views
Determining average of integers using quicksort
I was attempting an online problem given on a programming website which asked us to tell us the number of integers in a given list which can be obtained as an average of any two other integers in that ...
0
votes
0answers
16 views
Speed up Pandas DataFrame expansion to include time-lagged information about events
Using pandas and Python 3, information about a simple timeseries data set is being processed. Within the span of .5 seconds, 3 names are being said. We record the onset of each utterance, the length ...
2
votes
0answers
14 views
Computing values with several large numeric vectors
I have several large numeric vectors (close to 1e6 entries each) and I need to make some computations with their values:
...
3
votes
2answers
30 views
Calculating parsimonies using Python; performance is lacking
This program takes a very long time to do each and every step, even the very first print statement. Why is this, and what is the best way to diagnosing a problem like this in any language?
Also, I'd ...
12
votes
6answers
1k views
Password validation in Java
I just wrote this password validation code function that checks to see if a password will be accepted in AD or not. I'm not sure this is the best way to do it, but for now it works fine. I would love ...
12
votes
4answers
441 views
Voxel-based chunk manager
I'm creating a voxel-based game and have been working on it for quite a while.
I've come to a point where I have to load and unload chunks on the fly. I've created a chunk manager class and it's ...
1
vote
1answer
37 views
Obtaining weather station data from a MySQL database
I have a PHP page for a weather station that I'm trying to build.
I run multiple queries to pull out data from a MySQL database for min/max/average values for temp, pressure, humidity etc.
All of ...
4
votes
2answers
33 views
Improving performance in a Webdriver method
I'm testing an application which is not exactly an e-commerce application but which behaves enough like one that you can think of it as an e-commerce application for the purposes of understanding this ...
3
votes
2answers
66 views
Solution to Hackerrank challenge “Sherlock and Queries”
First, here is the full challenge description:
Watson gives to Sherlock an array: \$A_1, A_2, ..., A_N\$. He also gives to
Sherlock two other arrays: \$B_1, B_2, ..., B_M\$ and \$C_1, C_2, ..., ...
1
vote
1answer
17 views
6
votes
2answers
50 views
Performance of speech enhancement code for Android app
I wrote a speech enhancement code for an Android App. The algorithm runs on 256 size frames of voice samples. On my PC the code runs per about 5ms per frame, while on my Nexsus 5 it more like 50ms per ...
2
votes
1answer
62 views
Separating values in string and returning them as comma separated string
I am iterating through a set of values that are in the following string format:
69;#Statements;#44;#Clarifications;#45;#Suggestions;
(fields with multiple values ...
4
votes
3answers
107 views
Squaring all integers in an array [on hold]
I have a function that takes array and replaces all integer elements with their square:
...
1
vote
2answers
44 views
Putting all desktop items into a new folder
I'm quite a newbie with Python, but I wanted to try my own little project, so I made a small script that puts all the desktop icons/folders into a newly created folder (called "Desktop1") if there are ...
3
votes
1answer
48 views
Optimizing gulpfile.js
I'm fairly new to JavaScript and Gulp. I was following this article for creating my gulpfile, trying to follow best practices, but it seems to me that this peace of code can be optimized and written ...
2
votes
1answer
101 views
Performance in Hackerrank challenge “Sherlock and Queries”
I translated the solution by the author to his challenge from C++ to Python.
It seems to be correct, but I get timeouts for the test cases 6, 9 and 12.
Here is the full challenge description:
...
3
votes
2answers
118 views
Calculating sum of manhattan distances in a sliding puzzle
I would like some feed back on a method which calculates the sum of Manhattan distances for each tile in a sliding puzzle to its goal position in the goal puzzle.
Here is the code:
...
2
votes
2answers
46 views
Phone Number Extracting using RegEx And HtmlAgilityPack
I've written this whole code to extract cell numbers from a website. It is extracting numbers perfectly but very slowly, and it's also hanging my Form while Extracting.
...
6
votes
1answer
39 views
Tracking (uniform spacing) between 2D elements
The problem I am solving:
I select multiple 2D SVG elements in an editor(the elements
are in arbitrary positions on my canvas).
I run the function ...
3
votes
2answers
52 views
Performance of a method to mask all but one rectangular element on the page
The point of this code is to mask a page where the user is editing the page's 'body' content. This is in a CMS. The rest of the page is the website template (i.e. header, index bar etc...). I've ...
7
votes
4answers
281 views
Effectively calculate the result of geometric series
Given \$f(n) = 1 + x + x^2 + x^3 + \ldots + x^n\$ and the fact that computers take more time when multiplying two numbers than when adding, how can we work out the result with greater efficiency?
...
4
votes
2answers
145 views
Performance of hashmap-based session object
Unfortunately, I can't use the Tomcat session for storing the key/value pairs for each user (restricted because it's an IVR domain-based project).
But I need the same functionality like a ...
26
votes
3answers
945 views
Voxel World Optimization
This is not related to a Minecraft clone.
I am currently writing a turn-based strategy game like Final Fantasy Tactics. The game is played on floating voxel-style islands, which are generated from ...
1
vote
0answers
31 views
Comparing different string-matching functions
Here is a problem came from codingbat:
Given 2 strings, a and b, return the number of the positions where
they contain the same length 2 substring. So "xxcaazz" and "xxbaaz"
yields 3, since ...
1
vote
1answer
29 views
Decoding an element list
I have a function which I am calling an infinite number of times (or until a condition is met). The problem with this recursive function is that on a higher level, it is called by a worker thread ...
7
votes
6answers
1k views
Find prime numbers under N
I'm using the Sieve of Eratosthenes to find primes numbers under N. Is there any performance problems you see with my approach? I used the LinkedList<Integer> ...
1
vote
1answer
44 views
OpenMP code runs slower than single thread code
I'm making a program that takes an integer n and generates the first n Ulam numbers. I followed this guide about OpenMP.
This ...
1
vote
1answer
26 views
1
vote
1answer
74 views
Decreasing the runtime of this non-abundant sums solution
I have written a solution to problem 23 of Project Euler, and after doing some testing and editing, I've managed to get the run time down from 1.7443 seconds to 1.56616 seconds. The problem is
...
6
votes
2answers
184 views
Array from file
I have this code which is performed each time I click the 'show polygons' button. The problem is that it takes a few seconds to finish running through the code before actually drawing the polygons + ...
8
votes
2answers
121 views
A Specific Combination
This code is going to be included in my Minesweeper Probabilities project. (so far it only exists on the develop-branch)
The purpose is to return a specific combination, let's say for example that ...
3
votes
1answer
47 views
Averaging a list of intersecting rectangles
I have a list of rectangles as tuples (x, y, w, h). I need to find which ones intersect and if they do, average all the intersecting rectangles into a new rectangle. I also track the resultant ...
4
votes
2answers
132 views
IMDB website query to find actors by time period
I'm using data from a database from the IMDB website. The database consists of five relevant tables.
Actor (id, fname, lname, gender)
Movie (id, name, year, rank)
Director (id, fname, lname)
Cast ...
4
votes
1answer
115 views
MySQL IMDB Query Speed
I'm using data from a database from the IMDB website. The database consists of five relevant tables.
Actor (id, fname, lname, gender)
Movie (id, name, year, rank)
Director (id, fname, lname)
Cast ...
5
votes
1answer
339 views
Summing two time periods using JodaTime
I'm building a Java method to sum arithmetically two time periods, using the JodaTime library. My code works fine, but I think that it's possible optimize to reduce the time execution.
...
3
votes
3answers
191 views
SQL delivery query performance
I need a "little" help with an SQL query (MySQL).
I have the following tables:
COURIERS table:
...
11
votes
2answers
129 views
CSV reader using StreamReader and LINQ
Mostly due to readability, I am using the following code to
find a specific csv file on a drive
read that CSV file using a streamReader
parse it into a ...
7
votes
4answers
116 views
Simple compression algorithm
An implementation of a simple compression algorithm that's featured in a programming practice book.
My goals:
Robust: All error conditions must be handled properly. The specification indicated in ...
3
votes
1answer
31 views
How can I reverse the first K elements of an array?
I have an array and I need to make one function which has two parameters, array and K. I need to return a new array with only ...
2
votes
1answer
67 views
Can the performance of this canvas drawImage() test be improved?
I have a quite simple loop that draws an 8px by 8px image many times in a canvas in a tiling fashion. Currently it's drawing 7500 images each loop.
See the jsfiddle.
...
2
votes
0answers
30 views
Careful simulation of a 3D space [closed]
What is an accurate computer-description of space?
I've been building up my abilities with various population simulations, and I'd like to add a spacial element to them now. I'm self-taught with ...
2
votes
2answers
83 views
Filtering by value X from array Y with a fallback
I wrote a function that solve a special problem. But one of my 'special hardcore software engineers' told me that this is a bad solution - but he will not give me a better solution. So I ask you: What ...
1
vote
0answers
39 views
Efficient C Code Alternative to MATLAB's im2col
The function im2col in MATLAB is very useful to vectorize Patch based Image Processing algorithms.
The problem is the function isn't optimized and doesn't use C ...
3
votes
1answer
124 views
Interview task to efficiently find compact representation of nodes in tree and find big O time
I recently had an interview problem where I was asked to find a compact representation of nodes in a tree.
As an example, consider the following tree:
...
4
votes
2answers
61 views
Custom MultiIterator with type filter
I'll start with giving a bit of background as there are many classes involved and I can't attach all of them because that would make this question wildly too long. For the curios they can be found at ...
3
votes
1answer
42 views
jQuery cycle content of static HTML page
I am making a simple jQuery code that changes the content of a static HTML page when a button (previous/next aka left/right) are pressed. The page is static, so the content that must be cycled (images ...
1
vote
2answers
92 views
Large arrays make runtime very slow
So I have the following code that takes the input of two arrays, and apply some queries to match elements from DBpediaClassesArray with elements from ...
4
votes
1answer
52 views
Writing a faster mutable trie
I am implementing a mutable trie. I tested and it produces correct results. However, it is very slow. I benchmark it against plain old Data.Map, which is more than ...
5
votes
1answer
67 views
Increase the speed of this Caesar Cipher
Here's my attempt at a Caesar Cipher encoder/decoder.
If given a key, it will encrypt the given string. However, if you do not specify a key, it checks each of the 26 possible keys and returns the ...
8
votes
1answer
135 views
Increase download speed of code
I am making a download manager and in Java. My code is currently working and downloads at 430-450 kb/s. The same file, when downloaded using downthemall, gives 440-460 speed, and when using an ...