• Tim Peters's avatar
    x_mul(): Made life easier for C optimizers in the "grade school" · 115c888b
    Tim Peters yazdı
    algorithm.  MSVC 6 wasn't impressed <wink>.
    
    Something odd:  the x_mul algorithm appears to get substantially worse
    than quadratic time as the inputs grow larger:
    
    bits in each input   x_mul time   k_mul time
    ------------------   ----------   ----------
                 15360         0.01         0.00
                 30720         0.04         0.01
                 61440         0.16         0.04
                122880         0.64         0.14
                245760         2.56         0.40
                491520        10.76         1.23
                983040        71.28         3.69
               1966080       459.31        11.07
    
    That is, x_mul is perfectly quadratic-time until a little burp at
    2.56->10.76, and after that goes to hell in a hurry.  Under Karatsuba,
    doubling the input size "should take" 3 times longer instead of 4, and
    that remains the case throughout this range.  I conclude that my "be nice
    to the cache" reworkings of k_mul() are paying.
    115c888b
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...