Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

learn more… | top users | synonyms (1)

1
vote
0answers
177 views

Relatively simple function that mainly performs arithmetic is called many times - naive optimization using Cython by defining types causes slowdowns

The basic idea of the code is to calculate the push or pull force at a vertex, given the number of "push causing molecules" and "pull causing molecules" at a polygon vertex. The code thus mainly ...
1
vote
1answer
29 views

Ruby on Rails Method ActiveRecord Query Optimizations

So I have three methods and I'm not sure how to optimize them. I will be working on this and updating this post while I do but basically running these three methods is central to some parts of my ...
0
votes
0answers
59 views

Scanning file performance concerns - C++ vs. Java [on hold]

I converted code in Java to C++. The code is large, and to give an example, even simple code for scanning a file takes 60 seconds in C++, while it takes less than a few seconds in Java. The data ...
5
votes
1answer
56 views

Slowdown when swapping between views

I am working on a project called neoCode that takes a users input URL and turns it into HTML or Machine Code. I am so close to pushing this to TestFlight for beta testing but I have a pretty bad ...
5
votes
1answer
137 views

Reading large file, splitting by new line

I am reading a ~120 MB log file (~300 Million lines of text). ...
6
votes
1answer
71 views

Generating DOM from a complex strings via arrays

This is a revised and expanded version of Transforming complex strings into simple arrays My function grabPerson turns strings of user information from multiple ...
2
votes
1answer
62 views

Performance enhancement for collection manipulation

I have below snippet of code which gets all the available menu items for a zone(top or left)and adds the widgets for which user has access to an ArrayList collection. For now the ...
4
votes
2answers
70 views

“Vaishnav and Pizzas” challenge

I am trying to solve the below mentioned problem from HackerEarth. Although the results are fine, the code takes extraordinarily long time to run execute. I am pretty sure the problem is because of ...
1
vote
1answer
26 views

Speed up anagram method in Ruby

I'm working on a project to find anagrams of words. My goal is to figure out the longest anagrams out there. I took a look at my code and it works but is woefully inefficient. I have two arrays, each ...
3
votes
1answer
75 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
24 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
16 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
31 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 ...
15
votes
7answers
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
477 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
42 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
40 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
115 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
19 views

MySQL proliferation of subqueries and left joins

I have the following query: ...
6
votes
2answers
55 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
75 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 ...
3
votes
2answers
73 views

Character range generator

I am working on trying to create a range function in JavaScript that imitates PERL's 'a'..'zz'. which expands to: a->z aa->az ba->bz ... za->zz And so on for every extra character you add to the ...
4
votes
3answers
112 views

Squaring all integers in an array [closed]

I have a function that takes array and replaces all integer elements with their square: ...
1
vote
2answers
46 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
65 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
110 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
127 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
60 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
44 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
54 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
287 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
150 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
962 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
34 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
49 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
27 views

Arduino Sketch for sending sensor turn on/off to computer

I'm having this Arduino Sketch: ...
1
vote
1answer
76 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
187 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
123 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
48 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
134 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
123 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
340 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
150 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
118 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
33 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
70 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. ...