|
![](/i/fill.gif) |
Warp wrote:
> "J�r�me M. Berger" <jeb### [at] free fr> wrote:
>> 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 i
t for
> your platform. It might make a big difference, especially with this typ
e
> of code.
It doesn't change anything here. Remember that the gcc shipped with
most 32-bits linux distros is configured to generate code for the
original Pentium! In this case, forcing the compiler to optimize for
your machine is usually a big win. On 64-bits platforms however,
there is not that much difference between the first generation
Athlon64 and the current generation.
> (Also -lm is probably not needed. At least I don't need it here.)
>
I originally didn't put it, but I added it because it was needed
for the C version. Now that the code is compiled as C++, you're
right it's not needed any more.
>> > ./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=nat
ive)
> 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...
>
So it seems...
> 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
>
--
mailto:jeb### [at] free fr
http://jeberger.free.fr
Jabber: jeb### [at] jabber fr
Post a reply to this message
Attachments:
Download 'us-ascii' (1 KB)
|
![](/i/fill.gif) |