Hacker News new | ask | show | jobs
by xeno42 4145 days ago
Additionally - Pushing the seed operation out of the loop decreased the run time for 1,000,000 samples from ~10 seconds to ~50ms on my machine.
1 comments

That is nice illustration of premature optimization. Instead of thinking "Lets parallelize", one should measure and find out what causes performance problems. Should one choose to go down the parallel path, it's a good idea to test if hyper threading degrades performance. In my experience it can be expensive use more than the physical cores.

edit: Another issue is that I really dont like when people present speedup in %. How should 540% speedup be interpreted? It makes more sense as a ratio, so we find sequential/parallel = 10067483333/1583584841 ~= 6.36. So the parallel version achieves a speedup factor of 6.36.

(6.36 - 1) *100 = 536 ~= 540,

So what distrinctiont are you trying to draw?

Yes I can do basic arithmetic. My point is that the ratio is easy to interpret, the program ran 6.36 times faster. The only reason I can think of for giving a percentage is to make it sound more impressive.