News for hackers. Stuff that matters.
Re:Cote D'Azur – Performance of pi calculation in multiple l... by MattPearce on Monday October 20, 2014 @12:48AM (#8480739)
The C code is quite unoptimised as well...

Running the original on my machine (compiled with VS2013) takes 3.75 seconds. Changing the comparison to (x * x + y * y) <= 1.0 (no need for the sqrt since we are comparing with 1!) takes the runtime down to 2.87 seconds. Switching the accumulation from a branch to hits+=in_circle(r1, r2) further reduces it to 2.43 seconds.

Re:Cote D'Azur – Performance of pi calculation in multiple l... by StefanKarpinski on Monday October 20, 2014 @01:43AM (#8480843)
To be fair, all of the codes use sqrt, so if you're going to do clever hand-optimizing in the C version, then you should do the same in the other ones too.