cpython/Objects
Tim Peters 696cf43b58 Heavily fiddled variant of patch #1442927: PyLong_FromString optimization.
``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%
2006-05-24 21:10:40 +00:00
..
abstract.c C++ compilation cleanup: Migrate declaration of 2006-04-18 00:27:46 +00:00
boolobject.c Remove unnecessary casts in type object initializers. 2006-03-30 11:57:00 +00:00
bufferobject.c More C++-compliance. Note especially listobject.c - to get C++ to accept the 2006-04-11 06:54:30 +00:00
cellobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
classobject.c Fix more ssize_t issues. 2006-04-22 11:40:03 +00:00
cobject.c Remove unnecessary casts in type object initializers. 2006-03-30 11:57:00 +00:00
codeobject.c Merge from rjones-funccall branch. 2006-05-23 10:37:38 +00:00
complexobject.c C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in a couple places 2006-04-18 00:35:43 +00:00
descrobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
dictnotes.txt Fix typos and add some elaborations 2004-03-15 15:52:22 +00:00
dictobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
enumobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
fileobject.c Bug #1462152: file() now checks more thoroughly for invalid mode 2006-05-18 07:01:27 +00:00
floatobject.c C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in a couple places 2006-04-18 00:35:43 +00:00
frameobject.c fix broken merge 2006-05-23 18:32:11 +00:00
funcobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
genobject.c gen_del(): Looks like much this was copy/pasted from 2006-04-15 22:59:10 +00:00
intobject.c C++ compiler cleanup: bunch-o-casts, plus use of unsigned loop index var in a couple places 2006-04-18 00:35:43 +00:00
iterobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
listobject.c Remove now-unused variables from tp_traverse and tp_clear methods. 2006-04-15 22:51:26 +00:00
listsort.txt The key to the various sort columns got lost. Pulled from 2005-09-23 17:14:22 +00:00
longobject.c Heavily fiddled variant of patch #1442927: PyLong_FromString optimization. 2006-05-24 21:10:40 +00:00
methodobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
moduleobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
object.c Comment typo fix 2006-04-18 11:49:53 +00:00
obmalloc.c Get compiling again 2006-04-11 07:58:54 +00:00
rangeobject.c Remove "static forward" declaration. Move constructors 2006-04-11 09:04:12 +00:00
setobject.c Clear dummy and emptyfrozenset, so that we don't have 2006-04-15 12:47:23 +00:00
sliceobject.c Allow long integers in PySlice_GetIndices. 2006-04-03 11:38:08 +00:00
stringobject.c docstring tweaks: count counts non-overlapping substrings, not 2006-05-22 15:35:12 +00:00
structseq.c Unlink the structseq type from the global list of 2006-04-15 12:45:05 +00:00
tupleobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00
typeobject.c Fix variable/format-char discrepancy in new-style class __getitem__, 2006-04-21 11:26:56 +00:00
unicodectype.c Enhance the performance of two important Unicode character 2005-10-20 19:06:35 +00:00
unicodeobject.c needforspeed: refactored the replace code slightly; special-case 2006-05-24 16:35:18 +00:00
unicodetype_db.h Update Unicode database to Unicode 4.1. 2006-03-09 23:38:20 +00:00
weakrefobject.c Use Py_VISIT in all tp_traverse methods, instead of traversing manually or 2006-04-15 21:47:09 +00:00