Message70508
[Tim]
> if you're concerned about speed, it would probably pay to eliminate all
> library calls except one to frexp().
Indeed it would! Here's a revised patch that avoids use of fmod. Speed is comparable with the current
version. Here are some timings for summing random values on OS X/Core 2 Duo, on a non-debug build of the
trunk. lsum is the patched version, msum is the version in the current trunk; timings are in seconds.
| lsum | msum
------------------------------------------------+----------+---------
50000 random values in [0, 1) | 0.003091 | 0.002540
50000 random values in [0, 1), sorted | 0.003202 | 0.003043
50000 random values in [0, 1), reverse order | 0.003201 | 0.002587
50000 random values in [-1, 1) | 0.003229 | 0.002829
50000 random values in [-1, 1), sorted | 0.003183 | 0.002629
50000 random values in [-1, 1), reverse order | 0.003195 | 0.002731
50000 random exponential values | 0.003994 | 0.006178
50000 random exponential values, sorted | 0.003713 | 0.007933
50000 random exponential values, reverse order | 0.003714 | 0.002849
Note that lsum doesn't suffer from the 'fragmentation of partials' problem that slows down msum for sorted
datasets.
I'll do some timings on Linux/x86 as well. |
|
Date |
User |
Action |
Args |
2008-07-31 14:28:03 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, rhettinger, MrJean1 |
2008-07-31 14:28:02 | mark.dickinson | set | messageid: <1217514482.57.0.921732228816.issue2819@psf.upfronthosting.co.za> |
2008-07-31 14:28:01 | mark.dickinson | link | issue2819 messages |
2008-07-31 14:28:00 | mark.dickinson | create | |
|