Re: vector of bin indices using histogram? [message #50764 is a reply to message #50762] |
Wed, 18 October 2006 09:56   |
Paolo Grigis
Messages: 171 Registered: December 2003
|
Senior Member |
|
|
Yes, you're right, we should use smaller arrays such
that everything fits into the cache.
Using your md.pro, the ratio DIV/MUL in my systems
are about:
pentium 4 : 6.6
xeon dual : 5.0
sparc : 2.9
Anybody with an AMD processor around?
Ciao,
Paolo
F�LDY Lajos wrote:
>
> On Wed, 18 Oct 2006, David Fanning wrote:
>
>> =?ISO-8859-2?Q?F=D6LDY_Lajos?= writes:
>>
>>> oops, I have to correct myself: FDIV latency is 23 clock cycles for
>>> float,
>>> 38 for double, and 43 for long double. Anyway, it is greater than 7.
>>
>>
>> Well, the multiplication is actually a bit faster on
>> my machine (Windows) than the division. So I'm not
>> at all sure how generalized this result is.
>>
>> Cheers,
>> David
>
>
> A little experiment with a surprising result, on a Pentium D 3.4 GHz
> with linux and IDL 6.2. The array size is small to avoid memory access
> latency.
>
> regards,
> lajos
>
>
> ; md.pro <- cut here
> a=sin(findgen(1000))*1e38
> nrep=1000000l
>
> t=systime(1)
> for j=1l,nrep do b=a/2.
> print, 'DIV: ', systime(1)-t
>
> t=systime(1)
> for j=1l,nrep do b=a*0.5
> print, 'MUL: ', systime(1)-t
>
> end
> ; md.pro <- cut here
>
>
> IDL> .ru md
> % Compiled module: $MAIN$.
> DIV: 13.824564
> MUL: 2.1084599
> IDL> .ru md
> % Compiled module: $MAIN$.
> DIV: 13.793007
> MUL: 2.0625601
> IDL> .ru md
> % Compiled module: $MAIN$.
> DIV: 13.829693
> MUL: 2.1155751
> IDL>
>
|
|
|