|
![](/i/fill.gif) |
> By simple curiosity, I've also added Warp's implementation of Isaac
> and here is the result (see attached code):
> > g++ -O3 -lm -o random random.cc IsaacRand.cc
I suggest adding -march=native in order for gcc to fully optimize it for
your platform. It might make a big difference, especially with this type
of code.
(Also -lm is probably not needed. At least I don't need it here.)
> > ./random
> Empty loop: 0ms
> Kiss64 (int): 6623ms
> Kiss64 (dbl): 5003ms
> Alvo (floor): 21539ms
> Alvo (cast): 14608ms
> Alvo (tmp+cast): 14664ms
> Isaac: 10540ms
I tried running the program on my Pentium4 (with g++ -O3 -march=native)
and got the following results:
Empty loop: 0ms
Kiss64 (int): 2669ms
Kiss64 (dbl): 2643ms
Alvo (floor): 2098ms
Alvo (cast): 1767ms
Alvo (tmp+cast): 1766ms
Isaac: 690ms
The speed seems to be pretty dependant on the CPU type being used...
Out of curiosity, I also tried adding -mfpmath=sse to the compiler options,
and the results changed a bit:
Empty loop: 0ms
Kiss64 (int): 2687ms
Kiss64 (dbl): 2640ms
Alvo (floor): 2424ms
Alvo (cast): 1294ms
Alvo (tmp+cast): 1335ms
Isaac: 685ms
--
- Warp
Post a reply to this message
|
![](/i/fill.gif) |