bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)


From: Pádraig Brady
Subject: bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)
Date: Mon, 08 Oct 2012 15:43:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 10/08/2012 02:21 PM, Torbjorn Granlund wrote:
Jim Meyering <address@hidden> 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]