|
|
Orchid XP v8 wrote:
> Severi Salminen wrote:
>
>> Which language? Any example of the code that shows what you are actually
>> doing?
>
> If I add up a few thousand 32-bit signed integers, it takes 20 seconds.
>
> If I use double-precision floating-point, it takes 43 seconds.
>
> If I use double-precision, and then convert each number to an integer,
> and then add it to the total, it takes 6 minutes.
>
> I'm wondering whether the hardware is actually that slow, or whether
> this is a performance bug in Haskell's number libraries.
I tried adding up 1e10 (10 billion, using Finnish meaning of "billion"
:) floats to a float variable (in 2 nested for loops). It took around
10s. Adding up 1e10 floats to an int variable took 30s. So the
conversion took some time. I tried with C++ with no optimizations at all.
But I agree with Warp. Adding up few thousand integers should definitely
not take 20s.
--
Severi Salminen
http://www.iki.fi/severi
Post a reply to this message
|
|