• Tim Peters's avatar
    Heavily fiddled variant of patch #1442927: PyLong_FromString optimization. · 696cf43b
    Tim Peters yazdı
    ``long(str, base)`` is now up to 6x faster for non-power-of-2 bases.  The
    largest speedup is for inputs with about 1000 decimal digits.  Conversion
    from non-power-of-2 bases remains quadratic-time in the number of input
    digits (it was and remains linear-time for bases 2, 4, 8, 16 and 32).
    
    Speedups at various lengths for decimal inputs, comparing 2.4.3 with
    current trunk.  Note that it's actually a bit slower for 1-digit strings:
    
      len  speedup
     ----  -------
       1     -4.5%
       2      4.6%
       3      8.3%
       4     12.7%
       5     16.9%
       6     28.6%
       7     35.5%
       8     44.3%
       9     46.6%
      10     55.3%
      11     65.7%
      12     77.7%
      13     73.4%
      14     75.3%
      15     85.2%
      16    103.0%
      17     95.1%
      18    112.8%
      19    117.9%
      20    128.3%
      30    174.5%
      40    209.3%
      50    236.3%
      60    254.3%
      70    262.9%
      80    295.8%
      90    297.3%
     100    324.5%
     200    374.6%
     300    403.1%
     400    391.1%
     500    388.7%
     600    440.6%
     700    468.7%
     800    498.0%
     900    507.2%
    1000    501.2%
    2000    450.2%
    3000    463.2%
    4000    452.5%
    5000    440.6%
    6000    439.6%
    7000    424.8%
    8000    418.1%
    9000    417.7%
    696cf43b
Adı
Son kayıt (commit)
Son güncelleme
..
abstract.c Loading commit data...
boolobject.c Loading commit data...
bufferobject.c Loading commit data...
cellobject.c Loading commit data...
classobject.c Loading commit data...
cobject.c Loading commit data...
codeobject.c Loading commit data...
complexobject.c Loading commit data...
descrobject.c Loading commit data...
dictnotes.txt Loading commit data...
dictobject.c Loading commit data...
enumobject.c Loading commit data...
fileobject.c Loading commit data...
floatobject.c Loading commit data...
frameobject.c Loading commit data...
funcobject.c Loading commit data...
genobject.c Loading commit data...
intobject.c Loading commit data...
iterobject.c Loading commit data...
listobject.c Loading commit data...
listsort.txt Loading commit data...
longobject.c Loading commit data...
methodobject.c Loading commit data...
moduleobject.c Loading commit data...
object.c Loading commit data...
obmalloc.c Loading commit data...
rangeobject.c Loading commit data...
setobject.c Loading commit data...
sliceobject.c Loading commit data...
stringobject.c Loading commit data...
structseq.c Loading commit data...
tupleobject.c Loading commit data...
typeobject.c Loading commit data...
unicodectype.c Loading commit data...
unicodeobject.c Loading commit data...
unicodetype_db.h Loading commit data...
weakrefobject.c Loading commit data...