the problem with factor is that any naive implementation will pale against
the one in gnu coreutils.
(gnu)
$ time factor 1267650600228402790082356974917
1267650600228402790082356974917: 1125899906842679 1125899906842723
real: 0m1.576s, user: 0m1.570s, sys: 0m0.003s
(yours with gmp)
$ time ./factor 1267650600228402790082356974917
1267650600228402790082356974917: 1125899906842723 1125899906842679
real: 1m11.109s, user: 1m11.013s, sys: 0m0.013s
(yours with tommath)
$ time ./factor 1267650600228402790082356974917
^C interrupted after 20 minutes
from at least 50x to more than 1000x slower than the gnu version.
does this suck less?
---
xoxo iza
Received on Fri Feb 26 2016 - 07:54:26 CET