Questions tagged [processing-efficiency]
622 questions
2
votes
1 answer
Detecting a solid color image on node.js
Iam using phantomjs for taking screen-shots but sometimes it fails and produces a solid grey image.
I just want to test whether a image is just a solid colour and if it is make a test fail.
What would be a really simple and efficient way of testing…

Alxs24
- 69
- 7
2
votes
2 answers
Efficient way to skip code every X iterations?
I'm using GameMaker Studio and you can think of it as a giant loop.
I use a counter variable step to keep track of what frame it is.
I'd like to run some code only every Xth step for efficiency.
if step mod 60 {
}
Would run that block every 60…

veta
- 716
- 9
- 22
2
votes
1 answer
How to improve the efficiency of the algorithm while using Iterator in java?
This is the question:
There are N boys and N girls. Only a boy and a girl can form a dancing pair (i.e. no same sex dancing pairs are allowed). The only other condition in making pairs is that their absolute difference in height should be less than…

Reem Aljunaid
- 109
- 1
- 9
2
votes
3 answers
Suitability of C# for clustered calculation-heavy apps?
I'm preparing to write a photonic simulation package that will run on a 128-node Linux and Windows cluster, with a Windows-based client for designing jobs (CAD-like) and submitting them to to the cluster.
Most of this is well-trod ground, but I'm…

3Dave
- 28,657
- 18
- 88
- 151
2
votes
1 answer
Where can I find the efficiency O(n) of some Numpy methods?
I am doing a school project and they've asked about the efficiency O(n) of some Numpy methods and I can't find them. Can anyone tell me where can I find those?
Example methods like:
numpy.linspace(x,y,z)
numpy.meshgrid(x,y)
numpy.zeroes(x,y)

Mahmoud Ayman
- 197
- 1
- 13
2
votes
3 answers
In terms of efficiency/quickly rejecting things, does it matter if your if statements are on the same line?
For example, say I want to find all numbers between 1 and 1000 that are divisible by 3 and 5. Would the code:
for i in range(1,1000):
if i % 3==0 and i %5 == 0:
blah
be less efficient than say
for i in range(1,1000):
if i%3==0:
…
user4854648
2
votes
1 answer
Looking for most efficient way to calc all distance vectors between set of points in 3D
I want to calculate all distance vectors between a set of points in 3 dimensions. All positions are stored in an array of shape (numberOfPoints, 3). Doing that with two loops takes almost 10 seconds for 1000 points.
The code for that is:
…

Asking Questions
- 637
- 6
- 18
2
votes
0 answers
Performance Impact of JSON_encode vs a JSON string
Hi I am basically trying to gauge the performance impact of creating a nested array structure which is then converted into JSON using json_encode() vs simply writing a string with valid JSON.
The language specifically is PHP, but I am also using…

Simon
- 723
- 8
- 14
2
votes
1 answer
Postgresql - Querying a column that is indexed by proxy of another column
I have the following query:
SELECT SUM(data), foreign_key
FROM (SELECT *
FROM really_big_table
ORDER BY auto_incremented_id DESC
LIMIT reasonable_number)
WHERE inserted_timestamp > now() - INTERVAL '1 hour'
GROUP BY foreign_key
This…

Jacklynn
- 1,503
- 1
- 13
- 23
2
votes
1 answer
Box filter approximations for the oriented gabor filters
I'm currently reading this paper: Approximations in the HMAX Model, I'm particularly interested in the approximation of the gabor filter using Box filters.
Last year I developed a synthetic fingerprint generator (you can see some of it here How to…

AngelCastillo
- 2,385
- 2
- 18
- 26
2
votes
6 answers
which is more efficient? repetitive assignment or repetitive checking
If I had a loop that checks for a specific value in an array and, for some reason, must iterate over all elements and cannot break midway.
Which of the following would be more efficient: blindly setting a flag on each match, or checking if the flag…

Sam Parker
- 31
- 3
2
votes
1 answer
More efficient int to double -- PortAudio, FFTW -- C/C++
I've written a program to open an audio stream using PortAudio, take a buffer of data, and FFT that data using the FFTW3 library. In the full program the FFT data is then processed and the program repeats itself until the user stops. The only way…

jonwooding
- 39
- 6
2
votes
1 answer
boost::multi_index composite keys efficiency
Long time reader first time poster! I'm playing around with the boost::multi_index container stuff and have a rather in-depth question that hopefully a boost or C++ container expert might know (my knowledge in C++ containers is pretty basic). For…

ConfusedBoostUser
- 35
- 4
2
votes
3 answers
Can an XML file be used as an efficient VB.NET backend?
Can an XML file be used efficiently as a database to a VB.NET application?
I already coded it this way and the application is running successfully.
Question is: when the storage/data size increases, will the program run in the same way as it is…

Pooh
- 105
- 1
- 3
- 12
2
votes
3 answers
Efficiency of splitting very long transliteration in Perl
I have this very long transliteration:
$text =~ tr/áàăâǎåǻäǟãȧǡąāȁȃɑʙƀɓƃćĉčċçȼƈɕʗďđðɖɗƌȡéèĕêěëėȩęēȅȇɇɛ/aaaaaaaaaaaaaaaaabbbbcccccccccdddddddeeeee/;
# Etc. (About 400 chars)
I want to split it into several transliterations since the resulting code…

calvillo
- 892
- 1
- 9
- 23