GNU bug report logs - #42269
Remove non-GMP code from coreutils factor.c

Previous Next

Package: coreutils;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Wed, 8 Jul 2020 16:27:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 42269 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Torbjörn Granlund <tg <at> gmplib.org>
Cc: nisse <at> lysator.liu.se, P <at> draigBrady.com, jay <at> gnu.org, 42269 <at> debbugs.gnu.org,
 jim <at> meyering.net
Subject: Re: bug#42269: Remove non-GMP code from coreutils factor.c
Date: Wed, 8 Jul 2020 19:08:36 -0700
[Message part 1 (text/plain, inline)]
On 7/8/20 12:34 PM, Torbjörn Granlund wrote:

> Any number which does not happen to be B-smooth for, say B < 2^30, will
> show easily measurable performance difference of 5x to 40x IIRC.

Ah, I had tried the example in the manual, (2^31 - 1) * (2^61 - 1). Even though 
it isn't B-smooth for B < 2^30, the performance difference was only 2x on my 
machine. I just now tried 2^127 - 1 and saw a similar performance difference, 
but 2^127 - 3 had a 15x difference so it's a better example.

I installed the attached to try to document this better.

> I have a patch which makes the non-GMP code some 2x - 3x faster.  It's
> been maturing for several years now, so I suppose I should really finish
> it.  (It got tangled with code which improves the GMP case by letting it
> fall into the non-GMP code as numbers get smaller.  That sounds simple
> but is quite messy for various reasons.  It is also not clear how much
> complexity we could defend for this command of limited utility.)

Yes, 'factor' is just a minor utility needed for POSIX compliance. Although it'd 
be nice to get that 2x-3x improvement whenever you have the time, it's not 
urgent. Thanks for your guidance on the GMP issue.

[0001-factor-explain-why-non-GMP-code-Bug-42269.patch (text/x-patch, attachment)]

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

Previous Next


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