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)

3
votes
0answers
19 views

Integrate the product of four infinite series functions

I wrote the following code to integrate the product of four functions. Two of the functions are hypergeometric functions and the other two are incomplete gamma functions. I have written each function ...
1
vote
1answer
22 views

Updating height of the rows in tables with jQuery

Does it make any sense and how to modify the JavaScript/jQuery code below to increase the performance? The working code is: ...
7
votes
1answer
94 views

The finest integers are palindromes

Challenge: Reverse the digits of a number and add it to the original until the number is a palindrome Specifications: Your program should accept as its first argument a path to a filename. ...
5
votes
2answers
56 views

Tile rendering/position updating performance

The code below grabs the contents of a .txt file, and scans each character of it, using that data to create a tile set. My main concern, is that for each loop, I am opening and closing a file each ...
2
votes
1answer
38 views

Optimizing search by id in some data in JSON structure

I have an object created by a JSON data. I need to retrieve the id for an object, I would like to know if a faster way exist, considering I am using for ..in loop. ...
0
votes
0answers
20 views

Optimize CSS Rule Dumper

I have written the following Tampermonkey/Greasemonkey script. I am trying to obtain a list of all CSS rules for a page; across all stylesheets. As of now, I am just iterating over everything. Is ...
2
votes
0answers
30 views

Creating chat box with comet

I'm writing chat application. I would like to know if there are problems in this code. This function sends message: ...
6
votes
1answer
95 views

An algorithm that finds the number of “lined up columns”

I found this question in an old exam in computer science. I solved it in a good way, but I'm not convinced that my solution is the best solution. I believe that there's a better way to solve it. ...
1
vote
4answers
68 views

Coupon collector

This is a coupon collector code to analyze the running time. I need some suggestions on improving the running times of this code. I have used the data structure dictionary, but is there any other data ...
1
vote
1answer
32 views

Get friend lists

I've never written on VKScript (and on Javascript). I need high performance code to get more friend lists faster. ...
4
votes
1answer
35 views

Showing items and categories after clicking on a subcategory

How can I speed up my app? It's very slow if I click on a button and open a new page. All data in time is local. I'm not sure if the problem is in my code or xamarinu. ...
3
votes
2answers
95 views

Hacker Rank - Lonely Integer

This is the problem statement for Lonely Integer. There are N integers in an array A. All but one integer occur in pairs. Your task is to find out the number that occurs only once. Input Format ...
6
votes
1answer
86 views

HackerRank - Insertion Sort - Part 2

This is the problem statement for Insertion Sort - Part 2. In Insertion Sort Part 1, you sorted one element into an array. Using the same approach repeatedly, can you sort an entire unsorted array? ...
8
votes
2answers
61 views

Encoding and decoding small strings of text

This is supposed to encode and decode small strings of text. Unfortunately, even on a really good laptop, it performs slowly. This might have to do with my looping, or just the sheer computation. It ...
4
votes
1answer
284 views

Powershell search millions of files as fast as possible

I once asked a similar question but in C#. Now I have the same problem in powershell.. What is the fastest way, to search files newer than 15 minutes, in a file system with more than 1 million files? ...
4
votes
0answers
46 views

Finding cycles in a graph that pass through a vertex at most k times

I have a project that relies on finding all cycles in a graph that pass through a vertex at most k times. Naturally, I'm sticking with the case of k=1 for the sake of development right now. I've come ...
5
votes
3answers
140 views

Optimize huge text file search

I have several huge 100MB text files that I need to scan through to pick out certain frame numbers which relate to a specific log packet of interest. My plan was to scan for these frame numbers and ...
4
votes
8answers
2k views

Project Euler #10 — Summation of primes takes forever

I have resolved the Problem presented in Project Euler #10: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. But this code takes too ...
5
votes
0answers
133 views

Database abstraction layer for PHP web application

I'm working on a PHP based web application. While building the UserStorage class, (which acts as a storage source for user data, and implements the ...
5
votes
2answers
62 views

Mandelbrot fractal with MPI

I'm not very familiar with MPI. I've written this little piece of code to draw the Mandelbrot fractal processing each row of the image in parallel. It works but it's really slow. I've written code to ...
3
votes
2answers
54 views

Shell script to count chess game outcomes

I came across this blog post by Adam Drake from around a year ago which is now making the rounds again. I made some improvements to his code, but wish to see if there are additional tweaks that could ...
12
votes
2answers
481 views

Reverse a sentence quickly without pointers

I am trying to reverse a sentence contained in a string and return a string in the quickest way possible using the least amount of memory. Also I don't want to use any unsafe code, so no pointers are ...
2
votes
2answers
91 views

Find Missing Numbers in an int list

I have an alternative algorithm to the same problem as Finding missing items in an int list. My implementation includes optional min and max bounds to selectively fill in the list. The linked ...
1
vote
1answer
78 views

What could I possibly change with this BFS and code to enhance its performance?

This code is supposed to find, in a graph, the node with the smallest maximum distance to all the other nodes. The problem can be found here. For instance, in this example graph: 2 is the node ...
4
votes
1answer
73 views

Performance optimization on Box2D with libgdx

A few days ago I decided that I wanted to get involved with libgdx. So far I'm blown away by how simple it is to get something on the screen to work with. I'm trying to make a very simple tech demo ...
1
vote
0answers
73 views

Quick estimation for empirical permutation and correlation test in R

I have two matrices (a, b), each including 3 genes and 6 observations. I have estimated the Spearman correlation for gene pairs (rcorr.observed). Then I want to do an empirical permutation (1000 ...
5
votes
1answer
74 views

Speeding up Python date conversion function currently using list comprehension and datetime

I am reading a large data file where the time is given in number of days since some epoch. I am currently converting this to Python's datetime format using this function: ...
1
vote
1answer
29 views

Dynamically calculate status in MLM

Problem: dynamically calculate status in MLM only based on a structure. It works correctly but it's so slow. Only test processing takes about 20 seconds. I tried to replace some lists by generators, ...
4
votes
1answer
43 views

Vectorization for temperature simulation

I'm new at Matlab and I would like to know tips in order to reduce the processing time of such program. The scheme of the actual code is very similar to typical C++ code and i would like to vectorize ...
3
votes
1answer
46 views

Detecting which properties have been changed from two objects

I have the following code. Providing two objects cmd and this.xxx.properties, script detects the only property changed and ...
2
votes
1answer
64 views

Accessing list elements when counting the number of rectilinear paths

I am trying to solve the RIVALS problem on SPOJ: Starting from (0, 0), how many paths are there to reach point (X, Y), only taking one-unit steps moving to the right or up? Constraints: 0 ≤ X ≤ 106, ...
9
votes
1answer
159 views

Individuals reproduce and mutate

How can I improve the performance (in terms of computation time) of this code? ...
2
votes
1answer
30 views

Reading a dynamic record length binary file

I am trying to read a dynamic record length binary file, which has data like this: field1field2field3field4vector1vector2 Here, field3 defines the occurrence of ...
5
votes
3answers
108 views

Counting letters as quickly as possible

I received a task, of taking a known text file (Linux dictionary), use threads to count the different letters in it, and present the results in an array. The code doesn't have to be pretty, elegant, ...
1
vote
1answer
68 views

Faster solution for row-wise matrix subtraction

I have 2 matrices. I have to calculate the euclidean distance between every row of matrix A and every row of matrix B. In the first solution I loop over the rows of the two matrices and for each row ...
3
votes
4answers
158 views

Java vs C++ (JAVAC)

Here's the problem for Java vs C++ (JAVAC): Java and C++ use different naming conventions. In Java a multiword identifier is constructed in the following manner: The first word is written ...
4
votes
1answer
76 views

Finding the minimum number of required deletions to have a non-repeating string

I wrote code for the following problem: Given a string, print out the number of deletions required so that the adjacent alphabets are distinct. Please suggest different methods by which I can ...
5
votes
2answers
135 views

Speed optimization for block XOR

In code I'm currently maintaining, there is a need to do very many repeated XOR operations of blocks of memory. The block size in my case is always 16 bytes. Because the code is executed very ...
2
votes
1answer
114 views

Loading 40GB twitter JSON TAR file from archive.org and load into PostgreSQL

I wrote the script below to load data obtained from the twitter JSON archive on archive.org into a PostgreSQL database. I'm looking for optimizations in the code. It currently runs at ~1.7 seconds ...
1
vote
4answers
108 views

Project Euler #1 - JavaScript

I'm new to JavaScript, and decided to learn the language by running through as many of the Project Euler problems as I have time to do. I just finished the first one, and am looking for some feedback, ...
4
votes
2answers
51 views

Faster way to perform function calculation in Python?

I'm interested in whether there is a way to further improve a "fast" version of a function used in a homework assignment I received recently (I've already submitted the completed work). ...
2
votes
0answers
64 views

Golang concurrent HTTP request

I wanted to test the performance of concurrent http request in Go against node.js: ...
2
votes
1answer
67 views

Javascript Performance Optimization

I am using the code below that loops around thousands of time, I need this to be as fast as possible, however I am not an expert in Javascript and all I know is that this code is faster than doing it ...
9
votes
1answer
79 views

Minesweeper analyze goes to N-Queensland

As @rolfl recently solved the N-Queens problem, I figured that it was time also for me to solve it. My approach is significantly different from @rolfl's. I quickly realized that the N-Queens problem ...
2
votes
1answer
35 views

SQL query to order by the difference between FIRST and BEST scores

Can anyone help me optimise this query? I have the following table: ...
0
votes
0answers
55 views

Recursive partition sort is inefficient

I have written a recursive method for a partition sort that sorts the array. However, when I use an array of more than 10-20 elements the program takes a really long time to complete. (On my computer ...
4
votes
1answer
42 views

C++11 class similar to .Net's ManualResetEvent, but without the ability to “reset”

The goal is to block all threads that call WaitOne(). When Set() is called, those threads continue. Any calls to ...
3
votes
2answers
149 views

Brute force algorithm for printing all possible alphanumeric combinations

I'm still very much a beginner, so I don't really know much about best practices or the speed of any particular C functions. You'll notice that I included a "cs50" library. This is from a MOOC I'm ...
4
votes
1answer
44 views

Flying-balls on a canvas element

I have made this little program for fun, to add on my personal webpage. I remember seeing something like it some time ago, don't remember exactly where, and I tried to reproduce it myself. As it ...
8
votes
2answers
90 views

Finding a password with brute force

The purpose of this code is to find a password with brute force cracking where as it will try all the possible combinations until it finds the correct password. For example, it will start like a then ...