On 10/08/2012 02:21 PM, Torbjorn Granlund wrote:
Jim Meyering <[email protected]> writes:
However, this little command does a lot of I/O, too:
191M input, 77M output.
Sure. I've never seen significant variance for such stuff, measurable
as CPU time.
I tested with a Sandybridge i3-2120T now. The range takes 32 s.
In both cases, the systems run GNU/Linux. The kernel version is 3.2.
The factoring speed varies very much with GCC version. I particular the
trial division code has a very tight loop, and such loops have more
compiler reliance. GCC 4.6 an later generate code that executes 4 insns
per (unsuccessful) division.
gcc (GCC) 4.6.0 20110603 (Red Hat 4.6.0-10)
With -march=native -O2
It is also important to use a 32bit binary. We should perhaps have
s/to use/to not use/ I presume. Yep I'm on 64 bit.
provided better 32-bit code paths to be used for numbers < 2^32 on
32-bit hardware. Now, Pádraig's example needs about 3x more time for a
32-bit binary on the same hardware.
thanks,
Pádraig.