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)

0
votes
0answers
3 views

Make logparser faster

I'm learning go. I wrote a simple logparser for SLF4J in Python some time ago and tried to port it to go as an exercise. The algorithm is identical, but the go-solution isn't quite as fast (the Python ...
0
votes
0answers
14 views

moving average implementation

I've created MovingAverage class. But it is not optimized for performance at all. I care about performance a little bit because i'm using this class in trading (i colocate on exchange and so on and so ...
3
votes
1answer
35 views

Increase performance of Boyer Moore

Here is my Boyer Moore code in Python: ...
8
votes
4answers
662 views

What would be preferred aesthetically and performance wise?

Which one of these two would you prefer writing in your code? This: ...
2
votes
0answers
27 views

Building a dict/list of lists?

I have code which is matching features within regions. The first thing it does it matches features from one region to an entire database of region features. So I have a mapping from query feature ...
3
votes
1answer
43 views

More efficient way to make a Tweeter status in a string of just words

I am making an application where I will be fetching tweets and storing them in a database. I will have a column for the complete text of the tweet and another where only the words of the tweet will ...
6
votes
2answers
41 views

Simple grid system made out of CSS columns

I have been researching and experimenting with HTML5 and CSS3. I was aiming to create a very simple but efficient tiled gallery / grids. So some sort of grid system that I can layout anything inside. ...
12
votes
1answer
76 views

Temperature Interpolation

I want to interpolate temperature in correlation with height. I have temperature data from stations with coordinates and height in this format: ...
6
votes
1answer
23 views

Calculating Euclidean norm for each vector in a sparse matrix

Below is a naive algorithm to find nearest neighbours for a point in some n-dimensional space. ...
2
votes
0answers
56 views

Eight Directions Crossword

I solved a problem which you can read about it here, but it gives me time limit exceeded even though it's 4 seconds. I really don't understand why, I don't think my code can be any simpler, basically ...
4
votes
2answers
61 views

Entity Framework Skip and Take too slow

The following code achieves what I require, reading 10000 rows at a time: var query = repository.Subscribers.ToList().Skip(numberToSkip).Take(numberInBatch); Is ...
5
votes
1answer
39 views

Strongly connected components algorithm

In my Python application, I am using Tarjan's algorithm to compute strongly connected components. Unfortunately, it shows up under profiling as one of the top functions in my application (at least ...
6
votes
1answer
48 views

Extraction of data from Flickr

I'm crawling Flickr for data for my university research project. However it's very slow and I'm not sure what it is exactly. It could be the FileWriter slowing it ...
8
votes
2answers
72 views

Comparing Server Version Number History

I have this code that compares all version numbers of servers. (The version numbers are stored in an XML file) Before the code would compare the current version number with the previous. This caused ...
14
votes
3answers
567 views

Planetary Nomenclature

I'm new when it comes to Java and programming in general, but I feel I have a decent grasp on a lot of the fundamentals. I've created this "random planet generator" that is virtually useless aside ...
4
votes
2answers
96 views

Can calculation of word wrapping be made notably faster?

I need to re-wrap a text so that it fits a given width, font and DC. The result needs to be an array of lines. I use the following code: ...
0
votes
0answers
30 views

Codeigniter ActiveRecord Wrapper Model

Can someone help me refactor this to be more optimized? Performance seems to be very optimal, but I think more can be squeezed from it. ...
5
votes
2answers
126 views

“Chef and Digits” Java solution

I am looking for a review on the following code which is for this question. I am looking for a general review of the code. I am specifically also looking for advice on how to make this code run more ...
6
votes
2answers
144 views

Inversion of an array that contains indices

I have an array of length n that contains numbers from 0 to n-1 in random order. I now want to "inverse" this array to one that where index i corresponds to the location of i in the source array. ...
3
votes
1answer
106 views

Seeding a file with fake records - doing concurrent updates

I need to seed a database with user data. When trying to write records to a file using sqlite3 with node, I tried writing the logic in a naive manner, without any error checks - but it was failing ...
4
votes
0answers
51 views

Manually Populate DataGridView With Accounts/Credentials

I'm designing a small account/password manager using C# and SQL Server CE. LINQ to SQL is my ORM of choice. Here's the data model representing how the SQL Server CE database is set up: And here's ...
3
votes
0answers
37 views

Prototype spider for indexing RSS feeds

This code is super slow. I'm looking for advice on how to improve its performance. ...
4
votes
2answers
76 views

Different factorial algorithm implementations and measuring their execution time

I'm new to C, and as an exercise I'm building 4 different factorial algorithm implementations and measuring their running time. I'm looking for this feedback, especially: The implementation of the ...
9
votes
3answers
141 views

How can I make my solution for Chef and Digits run faster?

Problem Statement Given n digits and m indices x from 1 to n, calculate the difference ...
4
votes
1answer
45 views

Code efficiency with many records

I have a bunch of functions that return strings based upon score ranges. Then I have another function that sums everything up and assigns a numeric weight. ...
3
votes
0answers
23 views

Is there a simpler or more efficient way to display random “ads” from an XML document?

I have an xml document that contains "ads" and includes information about the department name, image name, link to URL, and alt text. I have a ...
6
votes
2answers
68 views

Performance tuning on a text file to object conversion

I'm using an API which returns text in the following format: ...
2
votes
2answers
70 views

split string into container on char; efficiently?

Here is my single parse code for splitting a std::string on a char into a ...
6
votes
1answer
87 views

Merge sort could work 10 times faster

I am implementing merge sort in Java and I have a performance problem in this method: ...
3
votes
2answers
107 views

Prime generator program SPOJ time limit exceed

Problem Statement Input The input begins with the number t of test cases in a single line (t<=10). In each of the next t lines there are two numbers m and n (1 <= m <= n <= ...
6
votes
3answers
262 views

Performance analysis of 3 digits sum

I have a method that finds 3 numbers in an array that add up to a desired number. ...
3
votes
1answer
73 views

Loading, computation and writing 500.000 rows in database

first let me explain what I am trying to achieve here : I am supposed to compute some results, using data from several tables, filtered by a run_id. One of these tables has about 500.000 rows per ...
2
votes
1answer
53 views

Parsing MWNumericArray to C# code optimization

This is my function returning matrices from Matlab. This code run very slowly. I was trying to use Parallel.For in-order to run it in parallel threads but I got ...
16
votes
5answers
799 views

Count distinct primes, discarding palindromes, in under 2 seconds

Problem Statement Generate as many distinct primes P such that reverse (P) is also prime and is not equal to P. Output: Print per line one integer( ≤ 1015 ). Don't print more than ...
5
votes
2answers
173 views

How to verify if HTML table sort is stable or not?

I have implemented a HTML table sorting. I actually implemented a sort first using jQuery and then modified it based on the answer to this question for performance as I had done the same mistake. My ...
4
votes
1answer
48 views

Binary Tree Level Order Traversal Algoritm

I am trying to solve this Binary tree lever order traversal ...
0
votes
0answers
46 views

Translating CFRM algorithm from Java to Clojure, + 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: ...
11
votes
2answers
774 views

First prime number larger than given integer

How can I test this C program for "efficiency"? The most interesting usage is that it returns negative output for large enough input, otherwise the behavior is about expected. Will you suggest how to ...
7
votes
1answer
68 views

Compute stats on two class vectors

Below is a full working code example of code which is used to compute stats on two class vectors (partitions). There are two functions: pairwise_indication and ...
4
votes
2answers
74 views

Ping-pong JavaScript Canvas

I have created my first ping-pong game with JavaScript and Canvas. I will be glad if anybody can tell me how to optimize the code and functionality. https://github.com/nikitalarionov/js-pong First ...
6
votes
2answers
83 views

Ray Tracer main loop

For the past week I have been studying and improving a ray tracer that I ported from JavaScript. The bare finished port was only exactly what was written in JavaScript and rendered at around 20fps at ...
1
vote
1answer
147 views

Milliseconds to Time string & Time string to Milliseconds

Fast Time conversion I'm trying to write a very fast time-to-string and string-to-time function. I noticed that on low CPU mobile devices this function has, even if minimal, impact on the ...
6
votes
2answers
113 views

Speed up long running Ruby code

I'm running code which works fast locally, but when it's on Heroku it's slow. Heroku says this is because there is less memory and CPU power on my hosting than locally. I'm trying to rewrite my code ...
4
votes
0answers
43 views

Speed up my Google Apps Script for finding empty days on multiple calendars

I need help with a simple Google Apps Script I've written. The script finds days on which no all-day events have been scheduled, across multiple calendars. I'm fairly certain the main issue is the ...
-1
votes
2answers
54 views

QuadTree can't handle many elements

I'm currently implementing my own QuadTree in C++. It runs well with 100 items, but once you start adding more it slows down. remove, ...
7
votes
2answers
356 views

Determine quadrant of code

I'm currently in the process of coding a QuadTree. The QuadTree seperates into four quadrants, with 1 being the top right and 4 being the bottom right. I have this code to determine which quadrant ...
7
votes
5answers
464 views

Ten thousand and first prime checker takes a very long time

I am attempting problem 7 on Project Euler. I have come up with this solution which works fine for finding smaller nth prime numbers, but really lags when it comes to higher nth prime numbers. I am ...
5
votes
2answers
184 views

How best to keep track of an unknown number of objects?

I have a manager class that will manage an unknown number of objects. I'm currently storing the objects in a NSMutableArray object, and when I need to find one, I ...
5
votes
2answers
47 views

SQL Query that pulls rows in current table based on parent id optimization

I am creating a user permission system. I will have my user permissions set up off of "objects" and not pages. For example, I have an EVENTS section. Within that ...
4
votes
1answer
46 views

Improving the performance of my “type” function

I'm writing a JavaScript library, and I am using this function for type detection: ...