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

Mapping arbitrary Int values to a linear index space

This is part of a growing "primitive" tools collection here on github, and is the initial use-case for the IntArray for review here. Often, when processing data, you encounter unique values that you ...
7
votes
2answers
54 views

Using 2D arrays to make more efficient sequential storage

This code is part of a growing "primitive" tools collection here on github Use Case Consider: ...
2
votes
2answers
43 views

Frequency distribution of words and phrases

I need to find a way how to create a frequency distribution out of multilple text files. In fact I am asked to check the number of times a word or a phrase occurs in a txt file. The code should check ...
3
votes
1answer
31 views

OOP Blackjack game

I made this Blackjack game to help me learn the syntax of JavaScript classes and objects. As I was writing the game I felt like I was misusing the idea of oop. By that I mean I felt like some of the ...
1
vote
0answers
25 views

HDD Based AVL Tree

For class I have to write a program that reads (plaintext) numbers from a file, and inserts them into an AVL tree stored in another (binary) file. I cannot have more than about 10 nodes in memory at ...
-1
votes
0answers
11 views

batch rename files recursively to user entered depth of sub folders

Please review the code I am looking for improvement in terms of performance and testability. ...
2
votes
1answer
18 views

Sum of multiples of 3 or 5 below N

How do I improve speed of this code? The problem definition is "Find the sum of all the multiples of 3 or 5 below N". ...
3
votes
1answer
30 views

Factors sieve optimization

I have written a more powerful version of the sieve of Eratosthenes: this sieve returns the number of factors of all the numbers below the limit. Sadly the running ...
4
votes
3answers
75 views

Evaluation function for Connect Four

Here is some code I have written as a connect four negamax evaluation function. The state of the board is stored inside a class state. ...
1
vote
1answer
38 views

Preparing a walkthrough: Freeze effect :s

I have a method that load my walkthrough view. I have my view controller composed of a scroll view. And others views controllers used only for the walkthrough (maybe I should used xib uiview instead ...
2
votes
1answer
50 views

Bucket sort implementation

I want to optimize my code for performance and fine-tuned logic. ...
2
votes
2answers
60 views

Generating a random number of progress bars

I have this JSFiddle that generates a random number of progress bars then assigns a random number and percent to them. I am wondering if you know how to better optimize this code to have better ...
5
votes
1answer
41 views

Prefix trees for auto suggest

I wrote a quick prefix tree implementation. I know it may be far from perfect, but I need to make sure that I got the basics right. My main concerns are: Have I settled for the correct data ...
3
votes
1answer
34 views

Alerting users with a pop-up window

I'm relatively new at programming in general including Python. But I've tried to create a program in Python that alerts users through a pop up window to perform an action every 2 hours. ...
3
votes
1answer
38 views

Long running Python “server status” collector

I wrote a small program that collects the server status, caches it for a certain amount of seconds, and then sends that to a mothership server. It's broken down into a few pieces, starting with ...
4
votes
2answers
59 views

Replacing a For Each loop with something faster

I'm a very inexperienced VBA user, I've just created my first "For Each" loop but it's very slow. I'm happy that it works but eager to know if there is a alternative method that is quicker. Any ...
8
votes
1answer
62 views

Inspector Rubberduck - Take Two

Release 1.1 of Rubberduck only had a handful of implemented code inspections, more as a proof of concept than anything else. For release 1.2, we now have 19 implementations of our ...
8
votes
1answer
47 views

YAuB - Micro Benchmark Follow-on

Following some great advice here from Simon, I realized that I had over-engineered things, and that the Task builder methods were a horrible Java8 abstraxction. In Simon's words: "From a usability ...
0
votes
1answer
27 views

Networkx VS graph-tool

I'm working on graph mining, so I'm trying to find the best library to do that. I've read in here that "graph-tool" is faster, so I tried the same program who count the duplicated graphs (I call them ...
2
votes
0answers
52 views

Number processing slower with asm.js

I did a few times ago what I called a plasma in plain JavaScript: jsFiddle The idea is to use 2 oscillators (LFO) which have their frequency + phase driven by two oscillators each. Then we use ...
4
votes
0answers
35 views

Creation of Queen Ann's Lace fractal

I've created a program which recreates the Queen Ann's Lace fractal. However, when the amount of points that are being plotted increases, the points are plotted way slower. Is there any way to make it ...
3
votes
3answers
44 views

Speeding up create CRC function

I have a function like this: ...
9
votes
1answer
61 views

YAuB - Yet another Micro Benchmark

Note -> Follow-on question posted here: YAuB - Micro Benchmark Follow-on I recently answered this Beautiful String question, where the task is to maximize the value of a string by assigning each ...
1
vote
1answer
53 views

Two tables for storing comments

I have two tables for storing comments comments ...
-2
votes
0answers
20 views

Comparing two values to two other values efficiently [closed]

So for an important piece in my code (thats getting called a lot) I need to compare 2 doubles (a and b) to 2 other doubles (x and y) to meet the following conditions: return false if both a and b ...
4
votes
1answer
28 views

Pollard p - 1 implementation

I'm trying to implement the Pollard p - 1 algorithm seen here, in Java. It has a C implementation here. I am using it for numbers without any smaller factors so trial factorisation isn't needed. My ...
9
votes
3answers
372 views

The Beauty and the Strings

This originally appeared in Facebook's hacker cup 2013. Solving it was fun, though I find myself looping through similar data quite often. Challenge: Print the maximum beauty of strings. ...
1
vote
1answer
44 views

Performance shifting for SQL Database and Linq memory grouping

I am messing around with shifting between stored procedures and business layer EF getting data rapidly then processing in memory. This works and on a static data range of 3 months I get execution ...
4
votes
1answer
78 views

Binary search that returns bitwise complement of missing index

While re-writing some old JavaScript code to better handle large arrays, I ended up writing my own binary search method. I found many examples of binary search methods written in JavaScript, but all ...
4
votes
2answers
70 views

Averaging lists of values with duplicate keys

I have gene expression data that I represent as a list of genes and a list of lists of values. I average the expression data for any genes with the same name. For example: ...
1
vote
1answer
50 views

ROT13 algorithm in C

I am trying to learn C and I came across the ROT13 scrambling system used to store some passwords. Assuming the user types everything in correctly (uses 1 argument, uses a string not an int, etc.) ...
7
votes
3answers
73 views

Recursive filename search

I have created a little program to search a set of folders holding documents scanned. The folder structure is as follows: c:\images\year\month\date\documenttype\firstpartofdocumentNo.\ the ...
-1
votes
0answers
53 views

Is it good practice to use the correct data types? [closed]

This might be a stupid question but here goes: I'm unsure whether it's habit, laziness, or the correct thing to do. But I find myself using data types that I simply don't need to use, for the sake of ...
5
votes
1answer
104 views

Efficient Pandas to MySQL “UPDATE… WHERE”

I have a pandas DataFrame and a (MySQL) database with the same columns. The database is not managed by me. I want to update the values in the database in an "UPDATE... WHERE" style, updating only ...
3
votes
1answer
44 views

Toggling menus based on an ID

I have recently started using browserify and have created a custom module to toggle two menus based on the ID clicked and apply a transparent overlay effect behind the menu. I have got it working but ...
5
votes
3answers
96 views

Finding number pairs where the sum of their divisors are each other

Given a limit \$n\$, find all the pairs of values less than, or equal to n, which have the the property: ...
3
votes
1answer
51 views

Slow update function

I've been fiddling with Unity, trying to make nice walking/running animations. So, i found the Stealth tutorial and I used pretty much the same animator as the AI, only I only use Speed and ...
4
votes
2answers
99 views

Improving file writing performance

When I run this function for outputting an inverted index to a text file in Debug Configuration, it takes nearly two minutes (96 seconds) with a comparatively tiny dataset, 1252 records with the ...
6
votes
3answers
96 views

Sieve of Sundaram for Project Euler 7

This is a sequel to my previous question: Sieve of Sundaram for Project Euler 7: Python implementation slower than C++ and R I am trying to implement the Sieve of Sundaram in various languages to ...
3
votes
1answer
41 views

Join - order by vote-sum and check if user has voted

I have a vote and a comment table. Now I want to display all comments and order them by votes-sum. Sum because some votes can have a higher value than others. Therefore I want to display if the user ...
0
votes
0answers
17 views

Drawing the same 3D-model multiple times

I am looking ways to improve the efficiency of my draw method in XNA/Monogame and understand how things work. I have just a group of 4 models (bricks), (red, green, blue, yellow) I am drawing multiple ...
4
votes
0answers
32 views

Cellular automata path and fill algorithm

I have worked for a few days in my cellular automata path algorithm and an easy fill algorithm, but sometimes I get some weird fall in my FPS. If you need a preview ...
13
votes
2answers
229 views

“ACM ICPC Team” challenge on Hackerrank… Easy?

This challenge took me awhile to figure out, and it's characterized as "easy," so I'm sorta wondering what I missed. Problem Statement You are given a list of N people who are attending ...
2
votes
1answer
47 views

Checking for duplicate values in database with Python

I'm working on a Python application where I read and extract data from an HTML file. The data is stored in a list, and the number of items in a list is, on average, 50,000+. The items from the list ...
1
vote
1answer
22 views

Select Queries From Parent-Child Tables Model

I have two tables (parent-child model): Loans & Transactions. Each Loan row has multiple Transaction rows. I want to select all rows from Loans together with most recent row from Transactions. ...
1
vote
0answers
29 views

Correct, DRY, and efficient use of Django Managers?

I'm writing a custom Manager for my django app that lets you group django-enumfields: ...
3
votes
2answers
45 views

Rapid color replacement for in-memory BMP

A function that relatively quick replaces one color with another, in a memory-buffered BMP. I am trying to improve the performance as much as it is possible. The previous implementation of this ...
2
votes
2answers
52 views

Sieve of Eratosthenes JavaScript implementation - performance very slow over a certain number

I've been playing around with the code challenges on projecteuler.net. A few of them involve prime numbers, so I've created a function to find them based on the sieve of Eratosthenes. It works fine, ...
4
votes
0answers
93 views

malloc(), free(), realloc() using brk() and sbrk()

I recoded malloc() by using brk() and sbrk(). I just want some "reviews" to see if it is ...
7
votes
1answer
74 views

Xonix game in JavaScript

This is my very first program in JavaScript. I am trying to teach myself from JavaScript: The Definitive Guide, 6th Edition. The code is also available on my bitbucket. I decided to remake the ...