cpython/Objects
Mark Dickinson 0b666bfdf9 Issue #5512: speed up the long division algorithm for Python longs.
The basic algorithm remains the same; the most significant speedups
come from the following three changes:

  (1) normalize by shifting instead of multiplying and dividing
  (2) the old algorithm usually did an unnecessary extra iteration of
      the outer loop; remove this.  As a special case, this means that
      long divisions with a single-digit result run twice as fast as
      before.
  (3) make inner loop much tighter.

Various benchmarks show speedups of between 50% and 150% for long
integer divisions and modulo operations.
2009-03-23 18:25:13 +00:00
..
stringlib Issue 5237, Allow auto-numbered replacement fields in str.format() strings. 2009-03-14 11:57:26 +00:00
abstract.c Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
boolobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
bufferobject.c Change the warning emitted for using the buffer() object; memoryview() in 3.0 2008-08-08 04:15:53 +00:00
bytearrayobject.c fix funky indentation 2009-03-08 00:21:17 +00:00
bytes_methods.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
cellobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
classobject.c generate py3k warnings on __getslice__, __delslice__, and __setslice__ 2008-08-24 18:10:20 +00:00
cobject.c #3668: When PyArg_ParseTuple correctly parses a s* format, but raises an 2008-08-29 18:39:48 +00:00
codeobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
complexobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
descrobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
dictnotes.txt Patch #1397848: add the reasoning behind no-resize-on-shrinkage. 2007-02-15 09:51:35 +00:00
dictobject.c Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. 2009-01-01 14:11:22 +00:00
enumobject.c Convert from long to Py_ssize_t. 2008-07-24 07:04:55 +00:00
exceptions.c Issue 4804. Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions. 2009-02-10 13:32:24 +00:00
fileobject.c issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid. 2009-02-04 10:05:25 +00:00
floatobject.c Use correct capitalization of NaN 2008-10-04 01:02:29 +00:00
frameobject.c fix strange errors when setting attributes on tracebacks #4034 2009-03-18 20:52:15 +00:00
funcobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
genobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
intobject.c Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. 2009-01-07 18:40:40 +00:00
iterobject.c PEP 3123: Provide forward compatibility with Python 3.0, while keeping 2007-07-21 06:55:02 +00:00
listobject.c Issue 1242657: list(obj) can swallow KeyboardInterrupt. 2009-02-02 21:50:13 +00:00
listsort.txt Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
longobject.c Issue #5512: speed up the long division algorithm for Python longs. 2009-03-23 18:25:13 +00:00
methodobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
moduleobject.c This reverts r63675 based on the discussion in this thread: 2008-06-09 04:58:54 +00:00
object.c Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
obmalloc.c Bug #3951: Py_USING_MEMORY_DEBUGGER should not be enabled by default. 2008-09-25 04:12:50 +00:00
rangeobject.c Added better pickling support to xrange objects. 2008-06-10 04:01:23 +00:00
setobject.c Issue #3680: Reference cycles created through a dict, set or deque iterator did not get collected. 2009-01-01 14:11:22 +00:00
sliceobject.c Issue #3004: Minor fix to slice.indices(). slice(-10).indices(9) now 2008-06-20 14:53:43 +00:00
stringobject.c Issue #4850: Change COUNT_ALLOCS variables to Py_ssize_t. 2009-01-07 18:40:40 +00:00
structseq.c Fix: 2008-08-24 05:04:52 +00:00
tupleobject.c fix tuple.index() error message #5495 2009-03-15 14:38:55 +00:00
typeobject.c Fix a small nit in the error message if bool() falls back on __len__ and it returns the wrong type: it would tell the user that __nonzero__ should return bool or int. 2009-03-15 21:43:38 +00:00
unicodectype.c Issue #3811: The Unicode database was updated to 5.1. 2008-09-10 13:38:12 +00:00
unicodeobject.c There is no macro named SIZEOF_SSIZE_T. Should use SIZEOF_SIZE_T instead. 2009-03-21 10:32:52 +00:00
unicodetype_db.h Issue #3811: The Unicode database was updated to 5.1. 2008-09-10 13:38:12 +00:00
weakrefobject.c Fix #3634 invalid return value from _weakref.ref(Exception).__init__ 2008-09-09 20:55:01 +00:00