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)

0
votes
1answer
19 views

Counting distinct lists in a list

I'm trying to remove the duplicate from the list and count the list after removing the duplicates ...
-4
votes
2answers
38 views

Rewrite 12 consecutive ints based on bizarre logic

Despite looking terribly ugly, it is pretty interesting due to some specific connections to cellular automata theory. I'm looking for ways of simplifying it further. This program takes 2.7 seconds to ...
2
votes
1answer
56 views

Computing six dot products involving one common input vector

I have created a Matlab Simulink model with a series of dot products. Embedded Coder generates a for loop for each dot product, as evidenced by this excerpt of the generated output: ...
5
votes
2answers
69 views

Monte Carlo simulation of amoeba population

I wrote a simple Python simulation to answer the "Amoeba" population question posed here: A population of amoebas starts with 1. After 1 period that amoeba can divide into 1, 2, 3, or 0 (it can ...
4
votes
2answers
40 views

Re-arranging a list into columns

In short, what this script aims to do is take the following data: 1 Alpha Beta Delta 2 Beta Echo Foxtrot Kilo 3 Alpha Kilo 4 Beta Echo Kilo Zulu And re-arrange ...
0
votes
0answers
20 views

Prefetch in ARMv7

I have to implement Khatri Rao product between 2 matrices in C. Mathematically this is a column major access of data and I can not change that. But if I use preload ( PLD instruction in ARMv7 ) to ...
2
votes
1answer
48 views

JavaScript calendar widget

I'd like to know how I can refactor my JS code for usability. Currently my JavaScript uses some HTML to build out a simple calendar with the following functionality: a. opens into the current month ...
4
votes
1answer
73 views

Calculating running average in Java

I have a library which makes HTTP calls to my service. I was trying to calculate running average of how much time my service is taking on an average. Here is the core logic of how I am calculating ...
1
vote
0answers
21 views

Finding cointegrated pair with minimal t-score

The function findMinimal() receives a tuple from a list which contains 171 tuples, each of them go into the function one by one and, for each tuple, it searches the ...
0
votes
1answer
12 views

Cut Specific Rows and Paste to New Workbook Faster

I'm quite new to trying to write my own macros and I've been able to piece this one together, but it takes quite some time to run. Below is the macro for one value (I have to create workbooks for ~20 ...
8
votes
2answers
88 views

Finding a string whose MD5 starts like the digits of π

I tried to make a program to find a string whose MD5-hash starts like the digits of pi, where dot is omitted. Is there a faster way to do it than this: ...
0
votes
2answers
43 views

Effective Python 2/3 two-dimensional array initialisation

Recently I noticed that the idiomatic python two-dimensional array initialisation is extremely slow. I am wondering, is there a good, proper way of doing this simple task fast? Also, are those two ...
2
votes
1answer
41 views

PHP Custom $_GET checker function performance

I'm trying to follow the DRY programming philosophy and I am tired of running isset() and an if not empty statements for each ...
1
vote
1answer
30 views

Longest Palindromic Substring

I wrote the following code for this problem. The problem is to find the longest palindromic substring. I think it is correct and is working correctly for all the test cases I entered myself. Now, the ...
1
vote
1answer
17 views

Demographics information for EDI report

I am going through some of my companies EDI reports to see if I can make them faster/less expensive. There is a query that takes ~55 seconds to complete, and I am not sure that it should. I do not see ...
4
votes
0answers
53 views

Pseudo-parallel depth-first search

I'm writing a small program, that generates a file containing an adjancency matrix, it then reads from that file, constructs a graph and does something like a parallel dfs on it. How can I make the ...
5
votes
0answers
44 views

Making a logic Prolog compiler simpler with Java

Good morning! I'm student in philosophy taking some course in programing in order to have a better understanding of artificial intelligence. I'm actually doing my own Prolog compiler just like SWISH ...
-1
votes
0answers
11 views

How do i make this script work for any input file [closed]

i have this little script, it works my only problem is making it work for any input .csv file i throw at it. So far it only works if i specify exacly the file inside the function. ...
5
votes
2answers
225 views

Extracting values from dictionaries where the keys match

I have two Dictionaries with around 65,000 KeyValuePairs each. I used foreach and if-else statements to compare them and get values, but it goes very slow. How could I optimize my code and gain more ...
-1
votes
1answer
79 views

Motorola 6809 Prime finder

I'm trying to make a small program which takes a number (form 1 to 1000) and shows the primes between 2 and that number. Right now I have a quite functioning program (except a couple of bugs), but the ...
-2
votes
0answers
12 views

Combat game that keeps track of in-game stats and increased difficulty levels [closed]

Was curious of a more efficient way to accomplish the same tasks. ...
0
votes
0answers
17 views

SQL query with nested subqueries

The following query is taking over 800ms to run, and returning 300 rows. ...
2
votes
2answers
65 views

Adding two singly linked lists in C++

I took a challenge from a web site. I aim to have a runtime performance as good as possible. My solution was accepted, though I think it is not the most efficient because I saw others having a faster ...
5
votes
3answers
144 views

Interview coding test: Searcher

I did a task for an interview and the solution was not accepted. The task was to implement the class search function by name. The number of classes in the input data from 0 to 100000. Class names are ...
1
vote
2answers
72 views

Faster copying of images to change their PixelFormat

I have the following code below that creates a new Bitmap object the same as the original but to ensure that its PixelFormat is ...
4
votes
2answers
43 views

Counting from 0 to a number and back to zero, and space-padding the result to be a given length

I completed a task: The objective was to create a method with 2 arguments: a number to count to, and how many char/numbers in the resulting string. Result: Let's say that "number" is 5, so it will ...
4
votes
4answers
269 views

Data type detection for a CSV file parser

I am building a CSV file parser, and in order to get the appropriate Object to represent different data types found on the parsed files, I wrote the following function: ...
-3
votes
0answers
29 views

Variable s gives me a negative number [closed]

It's the second Euler project ...
0
votes
0answers
29 views

Pangram test with non-ASCII characters [closed]

Pangram Determine if a sentence is a pangram. Determine if a sentence is a pangram. A pangram (Greek: παν γράμμα, pan gramma, "every letter") is a sentence using every letter of the ...
4
votes
1answer
51 views

SQL query that flattens many-to-one relationships

I have a database with these tables, where each mapping table represents a "many-to-one" relationship between the table on the right and the table on the left (click to enlarge): I am selecting a ...
2
votes
1answer
43 views

Import data module

I have a custom module to import nodes from a .txt file. (Drupal 7). My problem is I have a lot of nodes to import and this function takes so much time. ...
2
votes
1answer
47 views

Performance optimization when switching from nested to flat representation (genetic algorithm)

The code below is the core of a Genetic Algorithm (NSGA-II to be precise, without crowding-distance calculation), but I've taken out all the GA-specific parts and made a generic example. I think I've ...
7
votes
2answers
254 views

Make Depth First Search program more efficient

This is a problem from programming contest. The original problem can be found here on hackerearth.com. In the first line there is one integer T denoting the number of test cases. Description of ...
3
votes
1answer
104 views

Runtime compiler performance

I've been playing about with runtime compilation to allow me to get/set runtime property values in C# and so far I have come up with a class. This allows me to write code like the following which ...
4
votes
3answers
139 views

Count words in a string

Continuing my TDD from exercism. Write a program that given a phrase can count the occurrences of each word in that phrase. For example for the input ...
3
votes
0answers
25 views

Rolling OLS algorithm in a dataframe

I want to be able to find a solution to run the following code in a much faster fashion (ideally something like dataframe.apply(func) which has the fastest speed, ...
-2
votes
5answers
116 views

Finding dice roll results in a combinable list of numbers

This code takes a selection of numbers between 1 to 9 which could be 1,2,3,4,5,6,7,8,9 or 1,2,4 or ...
2
votes
1answer
59 views

SE-like voting system

I've created a voting system that's similar to Stack Exchange's in a Ruby on Rails web app. It's working great - as far as I can tell, all the edge cases are caught. This is the action to cast a vote. ...
2
votes
0answers
38 views

PHP Lottery Simulator

I have a lottery simulator on my website that simulates you playing the lottery every week until your death and tells you how much you would have won or lost. It can take a custom number of balls and ...
5
votes
1answer
69 views

Computing the total different between a pixel and its neighborhood

I have C++ code which written for mex in MATLAB. It used to compute the total different between a pixel and its neighborhood (8 neighborhood in my code). The code ran and gave me an expected result. ...
2
votes
2answers
74 views

Copy Data from Informix to SQL Server

The following method copies data from Informix db to SQL Server db and it's so slow, I want to refactor it so it could be more readable and faster: ...
3
votes
3answers
534 views

Finding the candidate with the majority of ballots

I am doing a code wars problem and so far I have managed to loop through a collection to find the "winner" (defined by the String that appears more than ...
5
votes
1answer
50 views

Python Octree Implementation

I'm working with 3D point clouds stored in Numpy arrays. I'd succesfully used the scipy's KDTree implementation for task like k-neighbors search and outlier filtering. However I wanted to try the ...
3
votes
0answers
36 views

Inserting nodes into a trie data structure

I have a recursive algorithm that inserts nodes into a trie data structure but it seems to be running not well and takes over 10 mins to complete on a data set of about 1 million. All nodes contain a ...
3
votes
0answers
43 views

Computing intersection of 2D infinite lines

I wrote a small program to compute intersection of 2D infinite lines using Boost Geometry A line is defined by two points in Line class. The ...
3
votes
1answer
53 views

How to make doubly linked list design more efficient?

I have played recently and implemented doubly linked list with merge sort algorithm. I was wondering if there is any way of improving the algorithm further to make it as fast as possible (I know about ...
1
vote
0answers
38 views

Multiple Persons enter room simultaneously and exits after specific interval of time

Here is the link to git repo of my application I am currently implementing just to have better understanding of OOP as well as learning Concurrency (Atleast a try :D) What is the whole ...
2
votes
1answer
59 views

Parsing in between of brackets

I do parsing of the string in order to find wrapped sub-string inside brackets of the first level. a+(b+(d-g))+g+d, in this case I will need to separate ...
1
vote
2answers
42 views

Permute and count between nested dictionaries

Goal: Permute inner values between two dictionaries with matching outer key, Save permuatations in counter, Move to next outer key, update counter with new permutations. Problem: Many lookups on ...
1
vote
2answers
89 views

Iterating over thousands of objects to generate html

Currently I am working on a profiling unit that does not require stack traces to preserve the call stack, and can return the performance in a html format. All though the logging in itself is fairly ...