Tagged Questions

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
1answer
39 views

Octree code performance

I'm using a simple Octree in my program, wanted to know if my implementation could be faster. It is part of this program: https://github.com/Mortis69/rendera Octree.H: ...
5
votes
1answer
36 views

Get all points on a uniform discrete grid inside a circle's radius

I have a 2-dimensional grid defined by a known point gridCenter and distance between points gridStep and need to find all points ...
1
vote
1answer
29 views

Extracting a subgraph

Given a huge graph, I want to traverse it, in the fastest way possible, and extract a subgraph with the following properties: the starting node is specified the maximum number of elements and max ...
0
votes
1answer
18 views

Increase performance of a spate of 2x2 matrix multiplication

I would like to improve the performance of the piece of code below (in Fortran). It gives good results but the profiling tells me that it is where it spends most of its running time. Basically, it ...
0
votes
1answer
21 views

Improving excution time for list and sampling in Python

Here is my code for generating edge list based on Price model algorithm. I think there have two points to reduce execution time: use proper data type use faster random sampling Originally, I used ...
3
votes
1answer
22 views

Merging predicted values into measured values

I created the following function below to merge the real values with the predicted values (when real are absent) in a new column in data.frame. The function ...
1
vote
0answers
19 views

GIF background rollover

I made a cool roll-over in css which displays an animate gif when the parent is hovered. Here's my code : http://codepen.io/clemeeent/pen/oggzMa The problem is I will have about 40 .day like that, ...
5
votes
1answer
96 views

Codility MaxCounters Peformance in Python capping out at 77% performance

My problem is quite similar to the question found here, except I am attempting to answer the question in Python. Given an array of N counters, all initialized to 0, and an array ...
3
votes
2answers
36 views

Copy a directory from source to destination

I wrote a program that copies a directory from a source to a destination, similar to the cp utility. For this, I used the essential functions: ...
-1
votes
0answers
15 views

Example: Interfaces for adding data to a collection (readability, extensibility) [closed]

I'm looking for some good practice advises regarding designing class interfaces where multiple methods should be provided to do a single task. As an example: Adding data to a collection. Requirements ...
5
votes
2answers
195 views

Reading, counting, and processing integers from a text file

The following code reads a .txt file that contain only numbers. Read the first one, create a dynamic array and put the other numbers on it, made some procedures and in the end write a file with the ...
3
votes
2answers
108 views

Evaluating f(N,R) mod(m)

The goal is to find \$f(n,r)\mod(m)\$ for the given values of \$n\$, \$r\$, \$m\$, where \$m\$ is a prime number. $$f(n,r) = \dfrac{F(n)}{F(n-r) \cdot F(r)}$$ where $$F(n) = 1^1 \cdot 2^2 \cdot ...
0
votes
1answer
54 views
4
votes
1answer
29 views

Remove sections of content from Quora.com

I wrote a Chrome browser extension to hide Top Content posts from Quora, which bother users following too few topics. A user's feed in Quora.com starts as a list of posts relevant to the user, ...
3
votes
1answer
48 views

Speed optimization for transparent gradient blend algorithm

The following algorithm works correctly for the purposes that I need, which is to set the top side of an image with a transparent gradient blend. Any tips to optimize it for speed? ...
4
votes
2answers
113 views

Algorithm for describing chess positions

I have an interesting problem with my chess application. The application reads PGN files, and at any time while viewing a game from the file, the function below, when called, iterates over the ...
2
votes
0answers
39 views

Dapper helper service

I've written a very light wrapper around dapper to help with unit testing and streamlining the dapper commands I need. Execute() is a method created to remove the ...
0
votes
0answers
38 views

Fastest computation of N likelihoods on normal distributions

In the context of a Gibbs sampler, I profiled my code and my major bottleneck is the following: I need to compute the likelihood of N points assuming they have been drawn from N normal distributions ...
1
vote
2answers
116 views

Sieve of Erathosthenes speedup

While reading HackerNews, I learned about a data set of the first 50 million primes. This would be a lot, but his website has disclaimer: n this directory I have the first fifty million primes in ...
9
votes
1answer
82 views

Counting Words in Files - MATLAB style

Note: this question may seem quite large, but the code to review is actually quite short For my Matlab class I'm taking, I was given the task to write a function ...
1
vote
1answer
42 views

Search layout with 2 edittext and 2 buttons

I'm building an Android app and I'm new on building the UI on an .xml file. I've built a simple layout but I think that is not optimize very well. This component is a search layout with 2 edittext ...
4
votes
2answers
216 views

Scaling jsTree performance

I am using jsTree v1.0 (latest v3.0, they withdraw support from older versions) to display the hierarchy in my application. It was good until until I started showing groups/user up to 200 levels, but ...
3
votes
1answer
87 views

PermCheck Codility with time complexity of O(N)

I have this solution for Codility's PermCheck problem. In summary, the task is to check whether array A contains each number in \$1 \ldots N\$ exactly once. I got ...
1
vote
1answer
42 views

Better way of clone and then replace some attributes with jQuery

I have HTML code like this : ...
2
votes
2answers
69 views

Computing pairwise bitwise OR in a list of bit-strings

I am trying to solve this problem using Clojure: You are given a list of \$N\$ people who are attending ACM-ICPC World Finals. Each of them are either well versed in a topic or they are not. ...
3
votes
2answers
249 views

4x4 Sudoku solver performance

The code is for a 4x4 Sudoku solver. It works fine when there are a small number of unfilled spaces (0's) but when I give the whole matrix input as 0's or so the solver takes a very long time. I need ...
4
votes
4answers
50 views

Optimise runtime of filter character method

I'm trying to run the method below against a very large corpus and I need to optimize/reduce the run time for this method as it already takes up about 6 seconds to execute. Requirements: Check the ...
10
votes
1answer
105 views

Gray codes addition

As some of you know, I have been working with Gray codes and am trying to design a good gray_code class in modern C++. I will end up posting several parts of the ...
7
votes
3answers
130 views

Counting all pairs that differ by k

Given an array of numbers and another number k, how can I find the number of 2 elements such as their difference is equal to k? ...
5
votes
2answers
321 views

Shell sort seems inefficient

I am testing various sorting algorithms. Right now I am testing shell sort, insertion sort and selection sort. I ran all three algorithms on a randomly-generated list of 1000 integers. The selection ...
1
vote
0answers
43 views

Optimize QuadTree to find K Nearest Neighbors

I'm looking a way to make my k nearest neighbors search more efficient. The context of the question is that I'm given a list of topics that have a unique ID (integer) and a (x,y) coordinate (floats) ...
4
votes
2answers
69 views

Custom sorting a list of objects efficiently

I'm trying to make sorting of objects in my program as fast as possible. I know that sorting with a cmp function is deprecated in python 3.x and that using keys is faster, but I'm not sure how to get ...
7
votes
1answer
64 views

Simple micro-benchmarking library

I'm working on a simple micro-benchmarking library in Java. This library makes it easy to benchmark multiple reference implementations. You provide the inputs and trigger the calls, the library takes ...
12
votes
1answer
194 views

Find binary sequences with low peak sidelobe level of autocorrelation function

I would like to find all binary sequences from the specified range, which has low peak sidelobe level of its autocorrelation function. Here is solution (this is simplified version of the real code) ...
3
votes
2answers
58 views

Simplifying WebView

I started to code on Android, but I think my code is very heavy and may slow down the performance of my app. For example, when I run my app and I try to drag the page in one of my webviews, it's ...
3
votes
3answers
286 views

For a query over multiple databases, is it faster to do GROUP BY first or UNION first?

Having several databases with the same table, I need to group the union of the records. The xTables are stored in separate databases named by the year (this is by ...
4
votes
2answers
72 views

Fetch plist file

I have a plist file with many nested dictionaries inside of it, and I wanna fetch them all to my code. Isn't there any more efficient way to do that than nested for-loops? ...
2
votes
2answers
99 views

String compression using repeated character counts

Implement a method to perform basic string compression using the counts of repeated characters. For example, the string aabcccccaaa would become ...
5
votes
1answer
81 views

Function to run MySQL SELECT queries with no leaks

I am upgrading an old massive website that is a Classic ASP \ ASP.NET hybrid. I still have a long way to MVC. Right now I want to convert all code that uses ODBC to the mysql connector specific code. ...
3
votes
4answers
134 views

Faster Way of Comparing Generic Sets

The following extension method is the limiting factor in the performance of an application I am developing, according to Visual Studio 2012 Performance Analysis profiler. Is there a faster way to ...
9
votes
4answers
2k views

Brute force password cracker

I wrote this script for a proof of concept JavaScript password cracker: ...
2
votes
2answers
44 views

Changing IP of msloop

This changes the IP of msloop using WMI(Win32_NetworkAdapterConfiguration), which takes about 1~2sec. But, if I work on another computer, it works much much ...
6
votes
2answers
108 views

Generating 'Decent' numbers

While solving a problem from HackerRank, though it's aneasy one, I wrote this big program. Not sure if recursion is applicable and hold good but to me it looked like it isn't. However when I run the ...
0
votes
2answers
110 views

Increment a text field value

So let's take this code which increments a Javascript text field value: ...
4
votes
1answer
26 views

Grouping counts from tables by account ID

I'm working with this query to get counts from three different tables, and to group the results by account ID: ...
8
votes
2answers
95 views

Optimizing String combinations in Java

I need to obtain all combinations of a String of length k from the given elements. For example, for ...
1
vote
1answer
50 views

Trajectory optimizations

Here's a function doing some trajectory optimization in the following manner: ...
1
vote
0answers
32 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
58 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 ...
26
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 ...