Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.
2
votes
1answer
23 views
“back substitution” method for solving linear system
I'm using numpy to write the "back substitution" method for solving linear system where "A" is a nonsingular upper triangular matrix.
...
0
votes
0answers
33 views
lz77 is slow operating on byte arrays
I ported a lz77 implementation from java, changed it from operating on strings to bytes and improved its performance following the advices of this question.
Testing the performance, I found that ...
3
votes
0answers
18 views
SLOC Counter Script Optimization
I'm a HPC guy so I'm all about "make it work, then make it fast." I have a little bash script which gets a Physical Source Lines Of Code (PSLOC) and Logical SLOC (currently just of Java code, but it ...
2
votes
0answers
18 views
WPF canvas drawing very slow
I am building a map editor to easily create 2d levels. To visualize how my level looks like I am using a canvas. On this canvas I can select which block is filled with a certain type ( like solid ). I ...
0
votes
1answer
31 views
Calling jQuery plugin methods
I have two code snippets and the following questions:
Which uses the best practice and why?
Which one is good for performance?
Code 1
...
0
votes
0answers
5 views
-2
votes
1answer
63 views
Airport Simulator
I tried this program in both Orwell DevC++ and Visual Studio 2013 (program works correctly). My astonishment is the performance of the same program in both IDEs. While the former took only 395 ...
5
votes
2answers
366 views
Slow prime finder
This program runs in about 1.65 seconds on a 1.65GHz dual core processor.
I compile it with:
gcc -Wall -o ./program ./program.c -lm
Are there any optimizations ...
3
votes
1answer
49 views
Formatting “Bond, JAMES (Mr)”
I need to call this function over a big dataset. I need it to be as efficient as possible but still be readable. Can I make it anymore efficient by using a different function for capitalize or blank ...
4
votes
2answers
88 views
lz77 is quick on strings but not on bytes
I ported a lz77 implementation from java to c#, and it's working fine. Now I want it to compress bytes and not strings, as I need it for another project.
This is the porting, operating on string:
...
1
vote
0answers
27 views
Parallel Multiplier: an implementation of `RecursiveTask<V>`
This class is my attempt at creating a re-usable class that simplifies the parallel calculation of products. I would appreciate hints on all aspects especially the value of the threshold for which the ...
1
vote
0answers
36 views
Random Contraction Min Cut (Karger) - performance issues
(Offtopic note: I can't add a "networkx" tag.)
I reworked an old algorithm, this time not implementing the graph on my own, but building on the networkx module.
Script works fine for the tests and ...
4
votes
5answers
121 views
Calculating Fibonacci numbers
The following problem is currently taking more than 8 seconds to execute. Please help me to modify the program, so that execution time will be reduced.
...
3
votes
0answers
53 views
12-week staffing forecast LINQ query
I have a LINQ query that I am having trouble optimizing and takes about 5.5 seconds to run. I am using a view called StaffingResourceData and a table called StaffingForecasts.
Each StaffingResource ...
1
vote
1answer
46 views
Get relative path from to/from path
Is there a better way to optimize this code? It started with \$O(n^2)\$ (nested loops) then \$O(n)\$ (with index).
...
4
votes
3answers
61 views
Alberi puzzle creator - follow-up
This is a follow-up to this question.
Using his ExactCover class, I slightly modified Garth Rees' Alberi class to cope with ...
6
votes
0answers
88 views
Definitional Returns. Solved. Mostly
I have made the bold claim that a longstanding problem in Rebol is "now solved"...that of "definitional returns".
But of course, such claims need some peer review, and there's always some new trick ...
3
votes
1answer
44 views
Binary/yijing clock in Processing with excessive resource consumption
I've been learning processing for the last week or two, and I've made a couple of little 'desktop toy' type apps like this one that I'm quite pleased with. However, it just occurred to me today to ...
3
votes
0answers
67 views
Specialty tree structure - BK Tree
I've been working on a implementation of specialty tree structure called a BK-Tree (more here and here). Basically, it's a tree that allows relatively efficient querying for items within a specific ...
2
votes
2answers
46 views
Sum of proper divisors
Given a natural number \$n\$ (\$1 \le n \le 500000\$), please output the
summation of all its proper divisors.
Definition: A proper divisor of a natural number is the divisor that is ...
7
votes
1answer
83 views
“Dungeon Game” solution
I was tackling this problem and I ended up with code that is functional, but times out with really large input (meaning it's poorly optimized). I'm a beginner in programming and working out a ...
1
vote
2answers
26 views
Get list of indices from searching for values in list of lists
I have a list of lists of numbers. The numbers are in sequential order, ranging from 0 to n and each number only appears once. I want to loop over all the numbers in the list of lists and return the ...
5
votes
1answer
49 views
Plotting level and temperature data from many Excel sheets
I've been working on a code that reads in all the sheets of an Excel workbook, where the first two columns in each sheet are "Date" and "Time", and the next two columns are either "Level" and ...
6
votes
1answer
69 views
Check sum of all primes under two million
I'm exploring ruby by writing a code that checks the sum of all prime numbers under two million. As I am still in the process of learning ruby, I'm unfamiliar with all the standards and best ...
3
votes
1answer
71 views
Count Acute, Right and Obtuse triangles from n side lengths
EDIT : The Code after changes suggested by @vnp. CODE
Problem Statement: We have N sticks. The size of the ith stick is Ai. We want to know the number of different types of triangles created with ...
1
vote
1answer
43 views
Fixed Point Number to String
I recently learned about using fixed point arithmetic on embedded systems without floating point hardware, so I decided to code it. I tried to write in good style, but emphasized speed over style.
...
2
votes
2answers
44 views
Finding tiered income c-primer
My thoughts are to create a method that contains all of the variables declared. Is it better to say initialized?
I would like it to be more efficient but still as clear as possible for future ...
2
votes
1answer
42 views
Getting all files names and paths
I'm trying to get all files paths and names to index them in my database for faster search in future. I have used multithreading and parallel classes, but I'm couldn't get the performance I expected. ...
1
vote
0answers
36 views
lut_atan() implementation to calculate atan() fast [closed]
To calculate atan() fast I've coded lut_atan() implementation. Can anyone help me to find out why I'm getting "not consecutive access" message from GCC?
...
2
votes
1answer
87 views
Algorithm to find edges of groups of intersections running to slow
I have an algorithm that takes in an array of interections found between lines in an image. It then has to look for any instances where there are a group of intersections together, remove the middle ...
-1
votes
0answers
15 views
understanding synchronized keyword on AdapterManagerImpl a class of sling framework [closed]
I'm researching how sling framework work behind the sence. But my knowledge on multi thread programming is very limited to understand what they are doing, here's my issue:
This is the class i'm ...
3
votes
5answers
244 views
Loading and converting data from CSV
My application imports a CSV file and parses each row, turning it into an object in my code.
The speed for a 500,000 row x 68 column takes 2+ minutes to read. I've narrowed down the bottleneck to the ...
3
votes
1answer
28 views
Slow Performance of AJAX Submitted Webform
I am creating a poll that website visitors can then vote. I use a hosted CMS (Business Catalyst) so I have to do a lot of this with javascript.
I have the poll working but when I click submit it is ...
5
votes
2answers
48 views
Summing random numbers in parallel
I am playing around with parallelization in Java and am trying to see how to squeeze out more performance on my multi-core box. My machine has 6 physical cores, 12 with hyperthreading.
However, with ...
8
votes
1answer
334 views
Implementing a fast DBScan in C#
I tried to implement a DBScan in C# using kd-trees. I followed the implementation from here.
...
-1
votes
1answer
36 views
Optimize finding GCD of all pairs of divisors
I've come up with a solution for Euler Problem 530, but my code runs too slowly to actually get the answer (solving for 10^15). What can I do to optimize it to run faster?
...
0
votes
2answers
77 views
Wator planet program
I am working on optimizing a Wator program. I have a specific question about code, if you are familiar with it. There is a function which takes most of the time. I need your help to improve this ...
1
vote
1answer
38 views
Prices and contracts query
The query below is quite slow (taking about half a second). Any obvious things I could improve?
The PRICES table has about 21 million rows and 30 columns while ...
1
vote
1answer
54 views
Gathering metadata on files in GitHub
I am a relatively new programmer and am currently working on something with the egit GitHub client library which requires me to iterate over a bunch of values and if a condition is met, add a bunch of ...
3
votes
1answer
20 views
Label with Subtitle
This code shows a title with an image and subtitle:
What improvements can I make in this code and is there a better of doing this?
...
3
votes
2answers
506 views
Zeros in Factorial
Ram was busy calculating the factorials of some numbers. He saw a
pattern in the number of zeros in the end of the factorial. Let \$n\$ be
the number and \$Z(n)\$ be the number of zeros in ...
3
votes
1answer
74 views
VBA script to format an Excel sheet
I'm making an app in Excel-VBA, but when I have more than 50,000 records, my code runs very slow and the formatting takes about 33 seconds.
...
1
vote
2answers
59 views
Arduino microcontroller based event handler program, send sensor readings over serial bus
I am working on a project with an Arduino microcontroller and a Raspberry Pi. The code will have to do the following:
If the variance calculated of the ultrasonic sensor detections exceeds 1000, a ...
17
votes
2answers
245 views
Calculate all possible distributions of n objects to k containers
Let's say I have \$5\$ apples, thus \$n = 5\$. I have three bags (\$k = 3\$), each having the capacities of \$4\$, \$4\$ and \$2\$:
$$c = { \{4, 4, 2 \}}$$
I'd like to calculate the number of ways ...
-5
votes
0answers
31 views
Code optimization for java code that reads the data from the excel file [on hold]
The following code snippet reads the data from the workbook(Excel) and stores it as list of row objects.
...
9
votes
3answers
259 views
Garbage collection in JavaScript multiplayer game
I am currently creating a Multiplayer Game using node.js and web sockets. The client side is receiving the positional information and applying it to all the players on the client side. Each client ...
3
votes
1answer
52 views
Video frame to Minecraft map colors
I'm still somewhat new to C, so pardon me for any silly mistakes I've made.
I'm trying to convert video frames into Minecraft map colors using JNI and ...
1
vote
3answers
123 views
Collision detection algorithm
This is my second algorithm and I will try to make it as simple for you to understand how it works. It is pretty expensive and I'd like to make it more efficient.
.
It works by splitting a square ...
5
votes
1answer
50 views
Brainfuck to Java converter
Similar to the previous post Brainfuck Interpreter: Slower than a Snail?, it runs BF in java. The only difference is that the converter will convert the BF code into a compilable and fairly readable ...
10
votes
3answers
630 views
HashTable implementation in C++
I made a simple hash table and I was wondering if there was any way to increase the efficiency of search times. My table class is called Dictionary, because C# has ...