bug-coreutils
[Top][All Lists]
Advanced

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

bug#42269: Remove non-GMP code from coreutils factor.c


From: Paul Eggert
Subject: bug#42269: Remove non-GMP code from coreutils factor.c
Date: Wed, 8 Jul 2020 19:08:36 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

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.

Attachment: 0001-factor-explain-why-non-GMP-code-Bug-42269.patch
Description: Text Data


reply via email to

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