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)

1
vote
0answers
13 views

Rewrote my benchmark/timer library

I created a timer library called PHPBenchTime a few years ago, and decided to rewrite it last week. This new version is meant to add in missing functionality (pause/unpause) as well as expand on the ...
2
votes
0answers
13 views

Loader animation using Custom View in Android

I created a loader animation for an Android app: a simple 3 dots loader. Is this the correct way to animate by using TimerTask? ...
5
votes
0answers
54 views

Improving performance for Codility max slice swap problem

Problem Description: Find the maximum sum of a compact subsequence of array elements after performing a single swap operation. Solution: ...
5
votes
2answers
54 views

Array 2D pairwise function

I found myself in the need of a function to pairwise an array 2D so I created one: ...
8
votes
3answers
349 views

Finding the largest of a series of numbers being XORed

I'm working on solving a problem involving finding the largest of a series of numbers being XORed. This is the actual problem: Xorq has invented an encryption algorithm which uses bitwise XOR ...
2
votes
2answers
101 views

Are either of these better than other performance wise?

I have these few lines of code (written inside a Smarty .tpl file). ...
2
votes
0answers
33 views

Logging strategy setup

I finally set up my logging infrastructure to work as desired, however I feel like I had to do quite a lot things just to fulfill a few requirements. Now I'm worried if my approach has major ...
0
votes
0answers
18 views

Optimizing max similarity for WSD in python

I have a library for simple Word Sense Disambiguation (WSD), https://github.com/alvations/pywsd But i have a function for WSD based on the sum of maximum similarity score for every word. But it's a ...
5
votes
4answers
71 views

Optimizing nested loop in run length encoding function

I'm currently working on a tool that needs to decode, modify data, then re-encode that data using the Yaz0 format. Everything has been in a working state, but after running some code analysis on my ...
1
vote
0answers
16 views

Speed up projection of a bipartitie network for a big file using NetworkX and Pandas

I have a pretty big file (3 million lines) with each line being a person-to-event relationship. Ultimate, I want to project this bipartite network onto a single-mode, weighted, network, and write it ...
8
votes
4answers
166 views

Adding two sides of an array

The purpose of the program is to add 2 sides of an array starting from the bottom and top of both ends and to find the lowest difference at equal decrements of iteration. The program functions but ...
0
votes
0answers
15 views

Getting a list of all fines in a local disk

I wanted to get a list of all files in a local disk like C:\, so I wrote the Python script below to check the performance: ...
10
votes
1answer
114 views

Good performance when predicting future game states

This question is about my answer to this king-of-the-hill challenge on Code Golf. In short, the purpose of the challenge is to code a slime that, trough various possible moves gains control over an ...
7
votes
1answer
72 views

Perfect game loop

I've been working on development for an Android game, and this is the game loop I have so far: ...
7
votes
1answer
31 views

Primitive stack-based code interpreter

I've written an interpreter for a simple assembly-like language and it's performing slower than I would like. It's split into 3 files: the Parser that converts the source to a vector of ints, the VM ...
4
votes
2answers
48 views

Multiple dependent subqueries

This query currently takes approximately 250 seconds to run and I'd like to reduce it by as much as I can. I have tried using left joins instead of subqueries and it increases run time. ...
8
votes
2answers
54 views

How can I make this userform timer faster?

I have a userform that displays a goal time for workers to shoot for when completing a task. It also has a stopwatch on it that is controlled by a start, stop, and reset button on the userform. If the ...
10
votes
1answer
68 views

A directive allowing to make a whole DOM subtree readonly

What do you think about this directive? For each input, it traverses the DOM towards the root and if it finds an element with the class ...
0
votes
0answers
36 views

Command line multipart file downloader using requests

The code below downloads file in multiple chunks if split is set to some number, however there is a limit to maximum possible splits defined below by maxSplits if ...
5
votes
1answer
58 views

Efficiently matching IP addresses with a list of CIDRs

I am using Python3 to extract some information from a dictionary that contains 10k of CIDRs, but the running time is pretty long. Here is my purpose: I have a dictionary of CIDRs (10000) and a list ...
1
vote
1answer
50 views

After refactoring using template class, PHP file takes forever to load, timeout after 30 seconds at times

I've been learning how to code for the past 3 years about. I have made some really good progress I think, and right now I'm trying myself on creating an MVC framework. I found this awesome idea on ...
5
votes
1answer
40 views

Library database search with multiple JOINs is too slow

I have a MySQL query which runs very slowly. I've rewritten it many times but no improvements yet. My current query for advanced search takes about 60 secs to complete. Any suggestions for improving ...
3
votes
2answers
81 views

Timing Project Euler Problem 1

Is there a better way to time the functions and print the result and function name dynamically? ...
0
votes
1answer
44 views

Performance issue with conditionally removing keys from a dictionary [closed]

I'm new to Python (2.7 Spyder). My code takes a long time to execute, and seems overly complicated. I'd like to use the range function but it isn't behaving as expected so, I'm using a comparison of ...
2
votes
1answer
38 views

Improving performance in generating an Excel file

I am using this code to write more than 170,000 rows to an Excel document. All in all, the file generation process takes about 3 minutes total. (I've already shaved off about ten minutes by shaving ...
7
votes
3answers
147 views

Getting the top 10 stores within a category

I have the following query. I know there's an easier way to do this without the sub queries, or at least optimizing how they're used. I've read about cross joins and using ...
8
votes
2answers
107 views

Finding the longest Collatz sequence cycle

I wrote a program to calculate Collatz sequences for initial numbers between 1 and a given integer i, then find the one with the largest cycle length. My code is ...
5
votes
5answers
97 views

Improving efficiency for two sum

I am trying to solve this problem: Given an array of integers, find two numbers such that they add up to a specific target number. and this is my strategy: For each ...
4
votes
3answers
137 views

Modified Sieve of Eratosthenes has very long runtime

I am slowly moving through Project Euler, and have reached problem #10: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. I did a naive ...
3
votes
0answers
94 views

Game Engine :: Entity Component Design - Handling Input

I am currently creating a game engine for educational purposes. ECS Design Pattern The first design pattern I've included is the Entity/Component/System pattern. Therefore I've got a base singleton ...
0
votes
1answer
53 views

Faster way to parse file to array, compare to array in second file, write final file

I currently have an MGF file containing MS2 spectral data (QE_2706_229_sequest_high_conf.mgf). The file template is here, as well as a snippet of example: ...
6
votes
3answers
196 views

Inner product of random floats written to file

My goals are to make this code: faster more idiomatic C++ What the code does: take an integer command-line argument N make a vector of ...
1
vote
1answer
32 views

Identifying “Matching Bigrams” in Large Text Collection

I have a large number of plain text files (north of 20 GB), and I wish to find all "matching" "bigrams" between any two texts in this collection. More specifically, my workflow looks like this: for ...
2
votes
0answers
22 views

C code for hash-consing: how could its performance be increased?

I've isolated this function, cons, for hash-consing in C. It is where the bottleneck of my program is. How could its performance be improved? ...
3
votes
1answer
16 views

Bit compressing in JavaScript

I have an bit array var data = []; ... and I have the following function: jsPerf ...
2
votes
0answers
28 views

Tick module for the game

I tried to look up and suck in most of the information about optimizing this operation and this is what I came up with. As it's pretty much core of the game, I really would like to have it performant ...
1
vote
2answers
51 views

Looking for matching names among two text files

I'm trying to enhance the execution speed of my below code. I am using only vanilla JavaScript. I would be willing to bring in additional libraries and plugins as long as they will enhance the overall ...
15
votes
2answers
329 views
12
votes
4answers
203 views

I'm not sure if I still love Fibonacci, but my code is getting better. How much better?

Technically, this is a follow up to these two questions, but I have taken a radically different approach. Everybody Loves Fibonacci Does everyone still love Fibonacci I finally allowed myself to ...
-1
votes
0answers
35 views

Followup to BigInteger Cube Root Optimization

Followup to Followup: How do I optimize this Java cube root function for BigInteger? Here's my current code for this cube root approximation for BigInteger, which returns the integer part of the cube ...
3
votes
1answer
35 views

How to generate valid number of combinations of datacenter and its host id?

I have a list of datacenters, which are dc1, dc2 and dc3. And each datacenter has six ids as ...
1
vote
1answer
38 views

improve performance of recursive function in c# method

I'm trying to write a function which will cache objects in memory. The function below works, but performance is unbearable. What would you recommend to improve performance? ...
3
votes
2answers
93 views

Increase performance on canvas repainting

I'm working on a little project where I have to create sort of an image mask. Overall my code works quite good in all browsers but sporadically the animations "flickr" on Chrome (Windows). So I was ...
4
votes
1answer
66 views

Followup: How do I optimize this Java cube root function for BigInteger?

Followup to How do I optimize this Java cube root function for BigInteger? So I've tried several implementations of this algorithm. The version using only BigInteger sometimes results in a ...
6
votes
2answers
210 views

Producing a sorted wordcount with Spark

I'm currently learning how to use Apache Spark. In order to do so, I implemented a simple wordcount (not really original, I know). There already exists an example on the documentation providing the ...
6
votes
1answer
46 views

Convert WKT representations of geometries into GeoJson

I am working on a class library in C# to convert WKT to GeoJson. I am getting shapes in WKT out of MSSQL. A lot of the shapes ...
5
votes
4answers
371 views
5
votes
4answers
78 views

Stack implementation using only one queue in C

We start with an empty queue. For the push operation we simply insert the value to be pushed into the queue. The pop operation needs some manipulation. When we need to pop from the stack (simulated ...
0
votes
0answers
9 views

What's a good simple way to combat the n+1 problem? [migrated]

I'm trying to better understand performance in PHP. One issue I'm thinking about is the n+1 problem. By n+1 I mean something like this: ...
3
votes
3answers
72 views

CSV demographics analyzer seems to waste memory/move slowly

I'm much more fluent in JS, but I needed to sort a lot of dates, ages, genders, etc. from a tab-delimited text file so I wrote this. Could I get some tips on how to make this more efficient and more ...