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

3
votes
1answer
33 views

Generate voxel terrain with Perlin Noise

For my chunk generator for my game, it currently uses a triple nested loop, which seems very inefficient. It also seems like I could cut down a lot of code in the function somehow. Does anyone have ...
1
vote
0answers
11 views

Parsing data from big json field and geocode services then store to PostgreSQL using psycopg2 instead django-orm

This code works, but my boss told me that it's very bad code, and don't want to deploy it. It is my first time working as a programmer and I have at least 3 months of experience. ...
2
votes
1answer
32 views

Heaping up with the inqueries

Challenge: Given three query types simulate heap operations. Specifications: 1. "1 v" - Add an element v to the heap. 2. "2 v" - Delete the element v from the heap. 3. Print the ...
1
vote
1answer
18 views

FizzBuzz in the MIPS ISA

The title pretty much explains it. This is the first program I've written in assembly, so any criticism, either on programming style or saving instructions, would be appreciated. ...
0
votes
0answers
16 views

Splitting two ObservableCollections lightning fast

I'm working on wiring up a bindable Map for Xamarin Forms, and I need a fast way of dividing up the ObservableCollections (collection of map markers) as quickly as possible. Collections are a weak ...
2
votes
1answer
38 views

SICP exercise 1.3 - sum of squares of two largest of three numbers

From SICP Exercise 1.3: Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers. Square is: ...
1
vote
1answer
56 views

Two and a sub string

Challenge: Given two strings, A and B. Find if there is a substring that appears in both A and B. Specifications: Several test cases will be given to you in a single file. The first line ...
3
votes
1answer
29 views

YAGOP - Yet Another Generic Object Pool

While thinking about this question it struck me that one problem of linked data structures always seems to be loss of memory locality and performance could possibly be improved if all allocated nodes ...
9
votes
5answers
715 views
+50

Enter my Matrix

Here is my next Java assignment: create a Matrix class that can add and multiply two matrices together. I was given some code as a skeleton and then fleshed it out ...
0
votes
0answers
26 views

Removing/adding/updating items between 2 dictionaries based on 3 rules

I need to do 3 things: Remove entries that are not present in dic2 from dic1 Update the other data in ...
8
votes
4answers
394 views

Custom memcmp function

I have written my own memcmp() function for learning purposes: ...
1
vote
2answers
23 views

Efficiently index rows of numpy array by exclusion

I need a function that takes a numpy array and a row number as inputs and returns the array (or copy of the array) excluding the given row. I want to do this as efficiently as possible. ...
3
votes
2answers
39 views

Finding a pair of words from two files with a particular MD5

I have two txt files. Both contain 60k+ words in a list. I put together some code to loop through each file and concatenate the strings ...
1
vote
1answer
50 views

Templated linked list in Java

I recently reviewed some data structure concepts, so I implemented my own templated linked list. I am very interested about the code efficient and performance. ...
2
votes
2answers
47 views

Slice chunking in Go

I have a slice with ~2.1 million log message strings in it that I am parsing for regular expression matches. For any matches, I add it to a local slice and then return said slice. ...
1
vote
1answer
50 views

Grabs 10 bytes and converts it into a hex formatted string

I'm working on some code right now where the goal is to take in a byte stream and grab the data from the body of a message. The data is 10 bytes long and is meant to be translated into hex. ...
2
votes
2answers
72 views

Copying rows from one workbook to another

This code will copy data from a workbook and copy it to an existing (and open) workbook. At the beginning of the month this copy/paste works very quickly, but as the month goes on and the data also ...
1
vote
1answer
25 views

Using [ChildActionOnly] for generating links

I have a view which displays a list of items, in each row I'm going to have a link, a link in each row points to different location So base upon a property called ...
2
votes
0answers
25 views

Transform and transpose byte[] of 32bit image data in 24bit array image data

I would like to know if someone can think about a better solution for doing this stuff. I have an array of raw bitmap data in 32bit format (RGBA). I need to transform and transpose this array into a ...
2
votes
4answers
133 views

Consecutive whitespace reduction

I pursued an according algorithm with an absolute best performance, the following class embodies the solution. Any comment is welcome. ...
0
votes
0answers
21 views

Can this implementation heavily harm write performance? [on hold]

For some reason I need to reimplement a method of this interface: Task Save(ISagaData sagaData, Dictionary<string, string> sagaAuditMetadata); This is the ...
4
votes
1answer
55 views

Randomly choose a game executable from a folder

I've written a Universal Windows Application which allows you to select a folder and shows the icon and name of a random executable from anywhere in that folder. The intent is to be a Game Roulette, ...
0
votes
1answer
53 views

PHP Instant Message API

I am creating a chat API for Android developers, but it's slow -- the chat app is getting messages a little bit late. How can I improve the performance of my code? ...
0
votes
1answer
95 views

Finding all possible combination of alphabets of length 5

The code finds all the combination of alphabet with length 5 and saves it in a list(its ASCII value, minus 97). I want to optimize the code to reduce execution time. ...
1
vote
0answers
32 views

Reading content of directory for each HTTP request

I have a piece of code written in node and I wanted to know if I am in the right direction. Basically I have a site where the homepage lists 6 vehicle cards. Every time the page is requested I do the ...
1
vote
1answer
57 views

Returning the common divisors of two integers

I have written this function that returns the common divisors of two integers. When called recursively 10 times with big integers ranging in 100000000, it takes over 5 seconds. How can I improve it so ...
1
vote
1answer
66 views

Getting employee details according to the role

Here is my issue.I have two classes: ...
7
votes
1answer
85 views

Swift replacement for C's for-loop

I recently wrote an entry on my blog regarding unit testing using prime numbers as an example. When I wrote the entry, I wrote my code keeping in minding that proposal SE-0007 has been accepted for ...
6
votes
1answer
129 views

A* algorithm in C# for use in a game

I recently started up again on a 2D game engine I have been working on over the last couple of years. I managed to implement a version of the a* algorithm that seems to work fine for my game, but it ...
2
votes
1answer
32 views

Project Euler #7 in C: find 10001st prime using something like Sieve of Eratosthenes

I've gotten a solution for Project Euler #7 in C (find the 10,001st prime). I came up with the very simple algorithm myself (from what I can tell it's similar, if not identical, to the Sieve of ...
3
votes
1answer
51 views

PANDAS spatial clustering

I'am writing on a spatial clustering algorithm using pandas and scipy's kdtree. I profiled the code and the .loc part takes most time for bigger datasets. I wonder ...
3
votes
2answers
87 views

Slow merge sort

...
4
votes
1answer
35 views

Sieve of Eratosthenes in Erlang

I just started learning Erlang. Here is my crack at the Seive, based on (https://www.cs.hmc.edu/~oneill/papers/Sieve-JFP.pdf): ...
3
votes
1answer
47 views

Small HTML / JS drum machine

This is just a simple little drum machine. Since it loads sounds files, I can't just put it on JSFiddle. I tried Github pages too, but am not sure how to get the sound files working. However, you can ...
3
votes
4answers
97 views

C++ Interrupted Bubble Sort

I've written an interrupted bubble sort, which prints the intermediate result after some specified number of iterations of bubble sort. But I seem to have an speed issue. Could anyone help me spot ...
4
votes
1answer
67 views

Octree for voxels

I am creating a game with destructive terrain. Before I used a flat array to store the blocks, in chunks of 32^3. As I am aiming for detail and long view distance I would of course need some sort of ...
5
votes
2answers
25 views

Optimize Game of Life

I'm a beginner at coding and the past days I tried to write the famous "Conway's Game of Life" in Angular.js. Right now I'm done with the code and the game works. But if the size of the playground ...
1
vote
2answers
51 views

Implementation of merge sort in Python

I was working on an assignment and I was hoping to know if the merge sort algorithm I wrote in Python was not making any unnecessary computations. ...
4
votes
1answer
48 views

Data analytics on static file of 50,000+ tweets

I'm trying to optimize the main loop portion of this code, as well as learn any "best practices" insights I can for all of the code. This script currently reads in one large file full of tweets (50MB ...
5
votes
1answer
28 views

Perl recursive copy and move functions

I know a module like this already exists on CPAN, but I wanted to write my own simplified version that accepts wildcards in the input. I don't write many Perl modules so I figured I would post the ...
0
votes
1answer
56 views

HTML Pagination Generator

I have created a function that helps me generate pagination really easily but I am concerned about its performance mainly. The function accepts 2 parameters: A list of items (has meaning in the ...
1
vote
3answers
120 views

A service to monitor CPU usage

I have written a windows service that I am currently not that happy with as I am facing design issues (first windows service). The aim of this service is to monitor CPU usage and send an alert when ...
4
votes
1answer
46 views

SICP - exercise 2.69 - generate a huffman tree from a set of ordered leaves

From SICP Exercise 2.69: The following procedure takes as its argument a list of symbol-frequency pairs (where no symbol appears in more than one pair) and generates a Huffman encoding tree ...
6
votes
2answers
83 views

Attempting to run multiple simulations of the Gillespie algorithm for a set of stochastic chemical reactions in less than 10 minutes

I have written Python code that generates a plot. In the code below, when I set maxtime = 0.1, the program takes ~50s and when I set ...
2
votes
1answer
81 views

Project Euler Q7 - 10001st prime

The problem is (source)... By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10001st prime number? This is my second attempt ...
4
votes
1answer
48 views

Recursive backtracking Sudoku solver

I'm trying to learn more algorithmic techniques and I came across an interesting application of recursive backtracking: solving a Sudoku puzzle. I'm looking for a review concerning code style, ...
4
votes
1answer
44 views

Highlighting and copying spreadsheet rows that match a criterion

I use the code (provided below) to check for certain criteria in a row. In this case, if cell F in worksheet "Swivel" contains "After Dispute For SBU" then that row needs to be highlighted in yellow ...
1
vote
0answers
49 views

Restarting properly

I have an activity with a timer in it, which starts an activity when the timer goes down. Before, when onPause() would get called after a phone call, my activity ...
3
votes
1answer
48 views

Creating a table within a .csv file

I recently made a post on Code Review entitled Writing lists to .csv file. I found the feedback extremely helpful, and wished to provide a continuation of that particular topic; of working with Python ...
3
votes
2answers
49 views

Checking all elements against each other for elements strictly worse

Consider the following function: ...