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
11 views

K-Means in Rust

I have implemented for learning purposes a simple K-Means clustering algorithm in Rust. For those who are not familiar: you are given N points, say in the plane, ...
4
votes
1answer
46 views

Speeding up nested for-loop analysis code

I have two matrices, the first one is mat 2000*500, the second one is 6000*500 ...
24
votes
2answers
2k views

Quicksort implementation seems too slow with large data

I've written a program to compare different sorting algorithms with the array size being 10, 1,000, 100,000, 1,000,000 and 10,000,000. I, of course, expect Insertion to win out on 10 and merge heap ...
3
votes
2answers
72 views

Making this arraycopy more efficient

I'd like to find out how I can make my function more efficient: ...
4
votes
1answer
50 views

Fast regex to extract strings before and after a time

I want to get text1 and text2 by splitting time format Text1 10:24:02 Text2 Of the ...
2
votes
2answers
142 views

Comparing equivalent Scala and C# string-manipulation code - with Scala running much slower

I am very early in my journey of learning Scala, and I was doing challenges on hackerrank.com to get used to the syntax. As I finished one (very trivial) challenge, I noticed that the run times seem ...
3
votes
0answers
23 views

Calculating the distance squared between all vertex-pairs of a number of 2D polygons

I have implemented my code using Cython. It is the current bottleneck in my computations. There are two non-numpy functions involved: calculate_2D_dist_squared ...
11
votes
4answers
216 views

LW, MTD, STD, YTD Sales… all in line and looking pretty

That's Last Week, Month-to-Date, Season-to-Date, and Year-to-Date sales. I have a table-valued function for each one, that takes a date and returns all ...
0
votes
0answers
40 views

Linq to SQL ('select * from table').Count() vs (“select column from table”).Count() [migrated]

I am writing some linq queries where I came across following scenario: I want to fetch records from DB using Linq bases on some filter Here I want to take all record count also, so I did like ...
0
votes
0answers
14 views

App using JQueryMobile and Cordova

I have received a project that is built on Cordova with JQueryMobile. The app is already published on three platforms and is being used by 100K+ users. Now I have to add new functionality in it. But ...
9
votes
5answers
650 views

Find primes using “naive” algorithm

I know I can use Sieves to make this faster, but I wondered if there's anything I'm missing with this implementation of the "naive" algorithm. On my PC running the command (first million primes): ...
2
votes
1answer
40 views

CAPTCHA with images of objects

This CAPTCHA is not text but basically images of objects that the users has to identify between an array of options. My current code is kind-of slow because the query takes almost .7s to execute and ...
4
votes
4answers
285 views

Printing primes between user-given numbers

I want to display all the prime numbers between two integers taken from the user as input. Also I have to take a user input to specify the number of times the loop should run. Here is the Java code ...
2
votes
1answer
54 views

Perfect elimination ordering and high memory usage

The following code calculates a perfect elimination ordering in a special case in Haskell. I am less worried about its correctness than its high use of memory. The following code runs out of memory ...
0
votes
4answers
29 views

Speeding up script for processing three huge files

I have three huge files I need to process in order to rearrange the data contained within. The first file is a list of English example sentences (468,785 lines long). A typical line from this file ...
2
votes
2answers
69 views

Determining the next payment renewal date

I am not very good a JavaScript, surely not date manipulation, but I hacked together the script below with the purpose to determine the next payment renewal date based on a start date and payment ...
1
vote
1answer
82 views

Performance critical optimization routine with many arguments

A possibly similar question has been closed, but I'll give it a try anyway. A performance critical part of MATLAB code, a trajectory optimizer, has been moved to C (subroutine ...
1
vote
0answers
23 views

Optimise a spatial join for QGIS 2.0 Python plugin

I got a really great code review for a similar issue, but I seem to be unable to adapt it to another calculation for a QGIS 2.0 Python plugin. I am attaching field values to any features intersecting ...
3
votes
0answers
43 views

Finding the Cox regression coefficients in a mixed model for microarray data

I have written a code for a project which aims at finding the Cox regression coefficients in a mixed model for microarray data. The study was carried out on the Affymetrix Hgu133a platform. In the ...
6
votes
2answers
76 views

Parse floats from a string

While fixing some old code I came up with a class that parses floats from a string. This is used for parsing svg files in xml format. Floats can be separated by comma, space or anything at all in ...
3
votes
1answer
50 views

Implementing a linked list

I am studying data structures at the moment, so I want to see if there is anything wrong with my implementation of linked lists in C, after I checked Implementing an ArrayList. Header ...
2
votes
2answers
110 views

Improving the performance of Linq based solution

Again, out of fun on saturday night, I decided to solve the following problem from CodeEval. The challenge is finding the index of the lowest unique number. ...
2
votes
0answers
30 views

Speeding up this tfidf vectorizer

After thoroughly profiling my program, I have been able to pinpoint that it is being slowed down by the vectorizer. I am working on text data, and two lines of simple tfidf unigram vectorization is ...
1
vote
2answers
110 views

Project Euler #3 solution

I'm trying to solve Project Euler problem #3, which asks: The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? Can you please review ...
3
votes
2answers
39 views

Extract last record inserted for each key identifier

I have a table with this schema ID, int primary key PathKey, string not null InsertDate, datetime not null Value, int not null In the table there are a ...
5
votes
1answer
80 views

Vector comparison inside for-loop

The following code finds no-rain periods in a time series that were preceded by rain over a threshold (e.g. 10mm in 2 days [k=48]). ...
7
votes
4answers
104 views

Forming output of lines based on input

I have homework, in which I get number of cases and then four numbers. Each number tells how many rows there are in each column For example: 2 2 3 3 should be ...
1
vote
2answers
70 views

Code to generate a dictionary from two lists

I created a script to perform a union on 2 lists: keys and words. I needed to create a dictionary from them. If there are more keys than words, missing words are replaced with "None". Any excess words ...
4
votes
2answers
143 views

“Utopian Tree” challenge optimization

Problem statement The Utopian tree goes through 2 cycles of growth every year. The first growth cycle occurs during the monsoon, when it doubles in height. The second growth cycle occurs during the ...
0
votes
2answers
17 views

Adding cells to a table

I'm calling the below 2 function once per Cell in a table with over 135 columns and over 200 rows (that is 134*200 = 26800 times, I'm not running the functions on ...
3
votes
3answers
106 views

Speeding up storage of about 220000 values in Core Data

I use this code on the app's first run to save about 220000 values into core data. The file Navaids.txt has about 200000 and Waypoints.txt has about 20000 lines, where I get data from each line and ...
3
votes
2answers
74 views

Finding the runtime of a task by name

Can this query be improved? I iterate over a couple of thousand times, and if I can improve it, it should decrease the run time. Otherwise I might look into using a batch instead of doing one at a ...
1
vote
2answers
103 views

Weekly fee calculation

I have the following query. Its execution took 15 min and it's too much slow. Is there a way to optimize it? ...
4
votes
1answer
69 views

Simple Cellular Automata (think Conway's Game of Life) simulator

Firstly, let me say that this code works, as posted. It fills a 10x10 grid with a random color (black/white) then runs a cellular automata simulation on the grid, starting or pausing when the button ...
1
vote
1answer
126 views

Speed optimization for girth-counting algorithm

I have the following girth-counting algorithm on a large 0-1 matrix and I need to optimize it for speed: ...
4
votes
2answers
63 views

Efficient communication across multiple processors for finite elements

I am implementing finite element code using MPI. Obviously, when using MPI I will have to include communication between different nodes so that all processors have all relevant information. As this is ...
42
votes
3answers
1k views

Celebratory fireworks animation

To celebrate an important event, I hastily cobbled together an HTML canvas-based animation. A few concerns I have include: Performance: Does it run reasonably smoothly on most modern machines? How ...
1
vote
1answer
105 views

Optimizing a Google card layout

I'm developing an Android app in which I would build a card layout with a custom library. I think that my layout has not been optimized, but I don't know how I can this. It's not a very simple layout ...
1
vote
3answers
248 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
51 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 ...
6
votes
1answer
82 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
150 views

Reading large file, splitting by new line

I am reading a ~120 MB log file (~300 Million lines of text). ...
6
votes
1answer
75 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
2answers
77 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
74 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
37 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
82 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
33 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
19 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
33 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 ...