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)

2
votes
0answers
14 views

Factoring a number

Here's my program for factoring a number. It works, but it's quite slow. I'm looking for suggestions for optimizing. The lines are indented just for readability. ...
1
vote
0answers
12 views

Comparison of sprite movement implementations

I've come up with two ways to do sprite movement with CreateJS, and I'm wondering if one is better than the other as far as performance and maintainability. The player data is saved in a json file ...
4
votes
0answers
43 views

Python program that scrapes my CS teacher's website

I am new to programming, and I'm looking forward to seeing what I can do to improve my code. I've been working on creating an individual final project for my python CS class that checks my teacher's ...
3
votes
1answer
27 views

RPG game using XNA

I know this code needs some organization like classes, enums, methods, arrays or something but I just want to know if I could have created a character movement script, thereby shortening the code ...
6
votes
2answers
345 views

Checking if a number is prime

Is there a better way to check if a number is a prime? ...
1
vote
1answer
68 views

Project Euler 25 - 1000-digit Fibonacci Number

I have recently completed problem 25 from the project Euler site. The Fibonacci sequence is defined by the recurrence relation: Fn = Fn−1 + Fn−2, where F1 = 1 and F2 = 1. Hence the first 12 ...
5
votes
2answers
445 views

Project Euler 29 - Distinct Powers

I have just completed problem 29 from the Project Euler website: Consider all integer combinations of \$a^b\$ for \$2 \le a \le 5\$ and \$2 \le b \le 5\$: \$2^2=4\$, \$2^3=8\$, \$2^4=16\$, ...
4
votes
3answers
524 views

Nit picking performance on this search code

I am working on a fairly complex (at least it feels complex to me at the moment) search program and am looking to possibly increase the performance. Everything works exactly how I want it to, but I'm ...
0
votes
0answers
46 views

Compute pairs of distance covariances between variables [on hold]

This is a follow-up to Parallelize (or otherwise speed up) a double loop over a symmetric matrix I am analyzing a data set of just under 4,000 rows and 150 columns, and it contains a healthy number ...
2
votes
0answers
37 views

All combinations of a string with special characters

I have written a function which generates combinations of string by replacing 1 or more characters by the symbol "*". The code is as follows: ...
0
votes
1answer
9 views

Making events not trigger so often on a datatable with dc.js

I used this answer to make a table with datatables.net and dc.js. However, I detected a performance issue in this loop: ...
1
vote
2answers
42 views

Edit distance between 2 strings

I have written a program that calculates the "cost" of transforming one string into another. I would like you to review it. ...
6
votes
4answers
332 views

Constructing a JavaScript slide

I am a newbie to native JavaScript and am pretty much coming to grips with the operators, etc. At the moment I am currently constructing a slide. ...
8
votes
1answer
80 views

Java Trie structure

I recently have been working on a Trie in Java. I have looked at the related posts here on Code Review to try and enhance my code, but I do have some methods and constraints not present on other ...
8
votes
2answers
200 views

Finding the Mth to last Element

Challenge: Write a program which determines the Mth to last element in a list. Specifications: The first argument is a path to a file. The file contains series of space delimited ...
2
votes
1answer
29 views

Performance of parsing math functions

I wrote the following code as part of a larger application. This code takes a string that defines a mathematical function on such as r,y x[0], x[1] etc. or any ...
1
vote
1answer
27 views

Optimizing the performance of a nested for loop over millions of messages from SQLite Query - v2

I've posted and gotten help to optimize my code before here and here. Now I have implemented the following changes, after very helpful advice: I have implemented a Dictionary instead of using list ...
6
votes
2answers
132 views

Project Euler Problem 12 in Python

I'm trying to do Project Euler Problem 12, which reads as: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 ...
7
votes
2answers
234 views

Implementing a stack and using it to print alternate elements in reverse

Challenge: Implement a stack interface. Specifications: The interface should have ‘push’ and ‘pop’ functions. Your task is to ‘push’ a series of integers and then ‘pop’ and print every ...
2
votes
3answers
67 views

Sorting movie search results

I want to sort "movie search results" to get most probable movie that match "search". Input example: CARS.2.2011.720P.AC3.mkv I have a NameMatcher class ...
7
votes
2answers
286 views

The only thing better than being unique

is being first and unique. Challenge: Write a program which finds the first non-repeated character in a string. Specifications: The first argument is a path to a file. The file contains ...
3
votes
1answer
103 views

Counting the positive integer solutions of an equation

I have to solve this equation: \$ x + y + xy = n \$ ...
0
votes
0answers
11 views

Does declaring variables/caching selectors affect performance? [closed]

I'm not sure how jQuery works, but I assume caching selectors like this "hurts" performance as it searched through the DOM? ...
6
votes
2answers
204 views

Responsive text by JavaScript

I'm working on a JavaScript plugin that makes font-sizes flexible (for a responsive layout). The code works well so far, but I'm sure that it's capable of improvement (especially if you look at the ...
0
votes
1answer
22 views

Copy memory blocks of different sizes

Is there a better way than this to copy the values from source to destination when the blocks of memory you want to copy to and from are different sizes? Also considering you have no control over ...
2
votes
2answers
30 views

Improving performance while sorting a JavaScript Object

I am sorting an array (filtered) containing JS-Objects by their attribute sortdist: ...
1
vote
0answers
10 views

Optimizing a drawing a circular gradient in Python (aggdraw, PIL or SDL2)

I need to reduce the latency in creating a circular gradient of arbitrary radius that's then mapped to the current mouse position. Though the project uses OpenGL for video-card interaction, alas, ...
-2
votes
0answers
33 views
6
votes
2answers
71 views

Speeding up 2D shadow algorithm

I wrote a class to represent a set of lights in a 2D game that raycast in order to find shadows. The draw method does a lot of calculations and takes a lot of time. Mainly, the adding of areas and ...
2
votes
4answers
106 views

C-string appender for buffers and strings

Is this C appender safe, and reasonably optimal? ...
1
vote
1answer
61 views

Filtering a list based on conditions

I'm currently filtering a list based on several conditions, which may or may not be present: ...
3
votes
1answer
72 views

Iterative equation solver in Python

In order to solve a equation where the left hand side appears under an integral on the right hand side: $$ B(p^2) = C\int_0^{p^2}f_1\left(B(q^2),q^2\right)\mathrm{d}q^2 + C\int_{p^2}^{\Lambda^2} ...
3
votes
1answer
34 views

Spending a target sum, preferably split equally

I have a strange programming prompt. I managed to complete an algorithm to solve smaller test entries (which i'll post). One of my test cases has to complete a 200,000 int input and my algorithm isn't ...
3
votes
1answer
32 views

“Word-Target” Puzzle Solver in Java

Have recently been writing a few puzzle solvers in Java, this is my latest attempt. It solves the "Word-Target" puzzle found in some newspapers. You may have seen it before: Words must be found by ...
4
votes
0answers
44 views

Mapping arbitrary Int values to a linear index space

This is part of a growing "primitive" tools collection here on github, and is the initial use-case for the IntArray for review here. Often, when processing data, you encounter unique values that you ...
9
votes
2answers
78 views

Using 2D arrays to make more efficient sequential storage

This code is part of a growing "primitive" tools collection here on github Use Case Consider: ...
2
votes
2answers
57 views

Frequency distribution of words and phrases

I need to find a way how to create a frequency distribution out of multilple text files. In fact I am asked to check the number of times a word or a phrase occurs in a txt file. The code should check ...
3
votes
1answer
45 views

OOP Blackjack game

I made this Blackjack game to help me learn the syntax of JavaScript classes and objects. As I was writing the game I felt like I was misusing the idea of oop. By that I mean I felt like some of the ...
1
vote
0answers
33 views

HDD Based AVL Tree

For class I have to write a program that reads (plaintext) numbers from a file, and inserts them into an AVL tree stored in another (binary) file. I cannot have more than about 10 nodes in memory at ...
-1
votes
0answers
18 views

batch rename files recursively to user entered depth of sub folders

Please review the code I am looking for improvement in terms of performance and testability. ...
2
votes
1answer
25 views

Sum of multiples of 3 or 5 below N

How do I improve speed of this code? The problem definition is "Find the sum of all the multiples of 3 or 5 below N". ...
3
votes
1answer
34 views

Factors sieve optimization

I have written a more powerful version of the sieve of Eratosthenes: this sieve returns the number of factors of all the numbers below the limit. Sadly the running ...
4
votes
3answers
78 views

Evaluation function for Connect Four

Here is some code I have written as a connect four negamax evaluation function. The state of the board is stored inside a class state. ...
1
vote
1answer
42 views

Preparing a walkthrough: Freeze effect :s

I have a method that load my walkthrough view. I have my view controller composed of a scroll view. And others views controllers used only for the walkthrough (maybe I should used xib uiview instead ...
2
votes
1answer
57 views

Bucket sort implementation

I want to optimize my code for performance and fine-tuned logic. ...
2
votes
2answers
76 views

Generating a random number of progress bars

I have this JSFiddle that generates a random number of progress bars then assigns a random number and percent to them. I am wondering if you know how to better optimize this code to have better ...
6
votes
1answer
48 views

Prefix trees for auto suggest

I wrote a quick prefix tree implementation. I know it may be far from perfect, but I need to make sure that I got the basics right. My main concerns are: Have I settled for the correct data ...
4
votes
1answer
42 views

Alerting users with a pop-up window

I'm relatively new at programming in general including Python. But I've tried to create a program in Python that alerts users through a pop up window to perform an action every 2 hours. ...
3
votes
1answer
44 views

Long running Python “server status” collector

I wrote a small program that collects the server status, caches it for a certain amount of seconds, and then sends that to a mothership server. It's broken down into a few pieces, starting with ...
5
votes
2answers
73 views

Replacing a For Each loop with something faster

I'm a very inexperienced VBA user, I've just created my first "For Each" loop but it's very slow. I'm happy that it works but eager to know if there is a alternative method that is quicker. Any ...