]> git.ipfire.org Git - thirdparty/coreutils.git/commit
factor: 25% speed-up, on output
authorJim Meyering <meyering@redhat.com>
Tue, 18 Sep 2012 06:26:17 +0000 (08:26 +0200)
committerJim Meyering <meyering@redhat.com>
Thu, 4 Oct 2012 20:09:00 +0000 (22:09 +0200)
commit06b7ed8051d07677572e074d3d45007f1282ed56
tree95b309bfc6cb3ce60867f162d003300131de3522
parent759ebcb57db73449b5670204f85931d34881b7d2
factor: 25% speed-up, on output

* src/factor.c (print_factors_single): Use fputs and umaxtostr
rather than printf with "%ju".  This reduced the time required
to compute and print the factors of the first 10^7 integers from
over 8 seconds to 5.75s.  Run this command:
seq $((10**7)) | env time factor > /dev/null
src/factor.c