summing large arrays - or - performance of tight loops

Thomas Kuehne thomas-dloop at kuehne.cn
Mon Apr 23 10:52:00 PDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dave schrieb am 2007-04-19:
> Manfred Nowak wrote:
>> Dave wrote
>>> Mine were ran on a P4 chip and an AMD64 chip (original was
>>> Turion). 
>> 
>> It is disgusting to see, that three random benchmarkers all get 
>> different results. Mine were run on an AMD64 X2 under WinXP32 and 
>> compiled with DMD1.012.
>> 
>> Quotients (foreach/other):
>> Thomas: 200%
>> Dave:   100%
>> me:      85%
>> 
>> What causes those huge differences?
>> 
>> Here is my main:

<snip>

> I was using a simple 1024 x 1024 size array before.
>
> Using a 1024 x 1024 x 64 array, I got:
>
> P4:    97% (linux32 FC5)
> AMD64: 92% (WinXP32)
>
> So, the array size seems to make some difference, at least on AMD machines.

The results strongly depend on the memory architecture and to a lesser
extend on the element values. I've put an updated version online that
contains results for byte, short, int, long, float and double.

The benchmarking was done as follows:

dmd sum.html -O -release -inline -version=benchmark
./sum 2> /dev/null

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFGKhZsLK5blCcjpWoRAha5AJ40lu7apkLufJgfi8wFYiFfIuhWTACdGUJg
3MiQxN7N15GlC+J6OEilwuM=
=dXko
-----END PGP SIGNATURE-----



More information about the Digitalmars-d mailing list