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 (2)

3
votes
3answers
99 views

Find duplicates in List where all the numbers in between is <= than the duplicates

My function is supposed to go through a given List<Integer> and find integers of same value, but only count them if the ...
2
votes
0answers
23 views

R-Python sieve, 36 times slower than World Record

I decided to write a sieving prime-finding programme and make it fast. It works correctly but counting the primes below 10**9 takes 36 times as ...
4
votes
1answer
42 views

Finding number of primes till n - Sieve of Eratosthenes

I've written a ruby implementation for Sieve of Eratosthenes algorithm, however benchmarking it against the Ruby's Prime module I have still a far slower algorithm ...
3
votes
1answer
32 views

Necklace counting problem-with consecutive prime constraint

This is codeEval challenge to count the number of chains possible to make with beads holding numbers. Constraint is sum of the consecutive beads of chain should be a prime number. The standard ...
0
votes
0answers
29 views

PSR-4 Class Autoloader

The Psr4ClassAutoloader class autoloads classes based on the PSR-4 specification. I'd like to get a full on review of it. Specifically I'd also appreciate a ...
3
votes
1answer
28 views

Improving performance of VBA data validation script in Access with large data size

I work in IT compliance and one of my main duties is ensuring the integrity of employee network accounts. Partial VBA script as currently used is shown below: ...
4
votes
1answer
64 views

Numerate every item in dict

I have a .json file with a complex structure: dict in a dict, it has no constant structure and is dynamically changed. The goal is to make new dict where the keys are numbers of hierarchy and values ...
3
votes
2answers
50 views

Printing all the permutations of a string in alphabetical order-ver1.1

I adapted most of the suggestions from answers for my previous question Printing all the permutations of a string in alphabetical order to rewrote my solution again. Please let me know any more ...
-1
votes
1answer
32 views

Putting items in a sinusoidal arrangement

I would like to optimize the second line in my for loop(var phase). I believe moving parts of it outside of the loop would optimize performance. What can I move outside the for loop to improve ...
4
votes
1answer
78 views

Self Implemented Hash Map Performance

I have written two hash map implementations, one that stores Vertices and one that stores self implemented vectors of Edges. They are all fully functioning, however in my application they are quite ...
1
vote
2answers
41 views

Deduplicate data

I currently have an implementation that helps us deduplicate data but I know it's slow. Here's an example, note that I'm using OpenStruct here when really these are Mongoid objects pulled from the ...
0
votes
0answers
16 views

Binary Integer Linear Integer program returns non-integer values [closed]

I am trying to solve a large scale Binary Integer Linear program using pulp in python. The problem is that although I define variables to be "Binary" and "Integer" ...
2
votes
1answer
92 views

Small Clue game

I'm learning Java and was making a program to go along with the board game Clue. I type the name of who didn't do it and it takes them off the list. I want to evolve this program to be able to do ...
4
votes
2answers
126 views

Modern, C++ compliant, merge sort

This is a kind of follow up to my previous sort implementation review with specific questions to merge sort, and Modern C++ idioms. ...
4
votes
4answers
75 views

Quicksort Algorithm Efficiency

I've just tried my hand at Quicksort, and I seem to have gotten it working (thanks to Stack Overflow). However, is it "true" Quicksort? And is it decently written? ...
11
votes
2answers
2k views

I had one job to do

The code I am working with: ...
2
votes
2answers
76 views

Removing and counting words that appear more than once

The assignment is to remove the repeating string from a given string and get the count of repeated string. The code I have tried is below : ...
1
vote
2answers
57 views

Data loading Hash Map

I'm trying to improve my code's performance, and I've found an area where the execution time is being significantly increased. I've had a look through the code but I can't see how I can improve it. ...
0
votes
1answer
46 views

Plotting a trigonometric function appears to be too slow

This calculates the mobility and it's derivative of one element. If I calculate with 1 value of w, it's very fast. ...
4
votes
1answer
34 views

Maximum sum subarray efficiency — divide and conquer w/ vectors

I have successfully implemented a divide and conquer approach for find the maximum sum subarray (see code below). The code works fine and is correct, however I have an efficiency problem in that in ...
2
votes
2answers
52 views

Removing nested for loops to hasten API call response time

I've got an MVC APU project that I'm working on to feed data to some JavaScript charts. This beast below takes nearly 1 second of server time to process before it is served to the chart. I know that ...
7
votes
3answers
46 views

Saving and restoring RadixTree object

I have a large word-file which is fixed with over 240 000 words. I need to check if a specific word exists in this list. I thought that it would be a good idea to create a ...
6
votes
1answer
88 views

Rotating 3D wireframe

This code consumes a lot of CPU. Could you tell me where it is possible to improve the code or change the way rendering? Or it is possible to reduce the overhead of calculations? If you are using ...
1
vote
1answer
51 views

Pixel bit-wise LSB extraction to byte array

I wrote the following code below to extract the least significant bit (LSB) of each pixel and store it into a byte[] array. I was wondering if Java has a more ...
3
votes
1answer
39 views

Time lag on change function

I have a script to load a range of number. This range of number is only 200 lengths. However, it has a change function. When the start number is change, the the end number will try to find its range ...
4
votes
1answer
88 views

Sudoku app for Ruby

I have written a Sudoku app for Ruby. This is my first attempt at coding in Ruby so there are sure to be lots of way to optimise it or make it more efficient. To summarise the code: it takes an input ...
4
votes
2answers
59 views

C++ regex golf solver program much slower than original Python

I am rewriting Peter Norvig's Python regex golf solver in C++. I had originally planned to post the whole thing here at once when I was finished, but: This program takes double the time of the ...
4
votes
2answers
103 views

Converting a number to binary and back as a test in Java

This is one of my first takes on Java, coming mainly from Matlab I found I had many things to learn. The code will try to convert a number into an array of ones and zeros and then do the opposite ...
4
votes
2answers
61 views

Performance of Median routine using min performs abysmally

I am writing a routine to calculate median using the minimum of the numbers and then changing the value of the minimum to a large value outside the range of numbers (assuming you know the nature of ...
2
votes
0answers
20 views

Copy table using Selenium and Python

I have some Python code that copies a table from a website using Selenium, but as I haven't used Selenium much, I have that irksome feeling in the back of my mind that there must be a better way. It's ...
-3
votes
0answers
24 views
2
votes
1answer
31 views

Downloading, decompressing and inserting data into an SQLite database

I have implemented a Service, which executes three operations, in the following order: Downloading a compressed (.zip) CSV file Decompress the CSV file Reading the CSV file and inserting the data ...
2
votes
0answers
21 views

Processing 2 Sketch

I'm working on a processing sketch here. Main sketch: ...
3
votes
1answer
64 views

Discoknights game structure

I'm building a game with Pygame, a simple turn-based strategy game where on each turn a character can move and/or perform an action. I have a somewhat good structure for the game on the background, ...
2
votes
1answer
108 views

Receiving a JSON string response from a URL

I am using RestTemplate as my HttpClient to execute a URL while the server will return a JSON string as the response. The ...
6
votes
2answers
68 views

VBA Text Array - Scan two columns rather than one

I have some code which is designed to scan columns F and G for occurrences of words found in an array, the array containing text ...
3
votes
1answer
49 views

C++ port of my Ruby narcotic solitaire simulator

Having undergone a little "rediscovery" of C++, I decided to port my Ruby narcotic solitaire simulator program to it. My goal here is efficiency. This program is already about 5 times faster than the ...
4
votes
1answer
76 views

Using two wordlists to search a list of texts

I have a function that takes two separate wordlists and searches a third list, which is a text formatted as a list of wordlists. The function finds the proximity between words in ...
4
votes
2answers
53 views

Dispatching Brainfuck commands using if-else or dictionary

Here's the first, straightforward version of BF interpreter: ...
1
vote
1answer
23 views

NMEA AIS generator

I want to make some sort of NMEA AIS data generator. Now I wrote this code and it works quite well (does what I need from it), but I am sure it is bad and is to be optimized. The problem I see is ...
1
vote
1answer
21 views

Excel Laboratory Data Entry from Python 2.7

I've written a script to automate the entry of laboratory instrument data into an Excel spreadsheet using pandas and win32com. I've got the script functioning correctly, but it is painfully slow. In ...
1
vote
1answer
68 views

Filtering multiple large (>2gb) csv files with stock prices

I have a set of pretty large files (>2 GB, over 30m rows) containing intraday data in the following format: ...
0
votes
1answer
44 views

Efficient data migration

I'm trying to make a market depth chart with data from a exchange and a Google JS chart. The good news is I got it working, but the bad news is the code to prepare the data to be used by google ...
0
votes
1answer
24 views

Perform SELECT INTO Statement and add Primary Key afterwards

How can I improve this TSQL Statement in terms of performance? ...
-1
votes
2answers
47 views

Replacing Synchronization with Atomics

I have tried to make modification in below specified code by removing synchronized and replacing Integer with AtomicInteger . ...
2
votes
2answers
55 views

Inverting an image

The problem is that I am trying to modify the code to invert the image in C and optimize it to make it run faster than the original by any method I could think of. After tried to use blocking and loop ...
4
votes
3answers
66 views

Bitstream reader

I have a program which reads and analyses MPEG-TS files. I've been using gperftools to identify hotspots and optimize them, and 45% of all samples at this point are in my main bitstream reader ...
2
votes
0answers
56 views

Discretization of continuous attributes for automatic classification [closed]

Background In machine learning, it's common to encounter the problem of making a decision as to which discrete category an object belongs to based on a set of continuous attributes. For example, we ...
10
votes
4answers
575 views

Greatest Common Factor

I wrote this program to determine the Greatest Common Factor of any 2 given numbers, and would like to know of any improvements that can be made. I have tested it using a loop and 2 randomly generated ...