GNU bug report logs - #12350
Composites identified as primes in factor.c (when HAVE_GMP)

Previous Next

Package: coreutils;

Reported by: Torbjorn Granlund <tg <at> gmplib.org>

Date: Tue, 4 Sep 2012 13:29:02 UTC

Severity: normal

Done: Jim Meyering <meyering <at> hx.meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Pádraig Brady <P <at> draigBrady.com>
To: Torbjorn Granlund <tg <at> gmplib.org>
Cc: 12350 <at> debbugs.gnu.org, nisse <at> lysator.liu.se, Jim Meyering <jim <at> meyering.net>
Subject: bug#12350: Composites identified as primes in factor.c (when HAVE_GMP)
Date: Mon, 08 Oct 2012 15:43:41 +0100
On 10/08/2012 02:21 PM, Torbjorn Granlund wrote:
> Jim Meyering <jim <at> meyering.net> 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.




This bug report was last modified 12 years and 276 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.