cpython/Objects
Raymond Hettinger 019a148c72 Optimize dictionary iterators.
* Split into three separate types that share everything except the
  code for iternext.  Saves run time decision making and allows
  each iternext function to be specialized.

* Inlined PyDict_Next().  In addition to saving a function call, this
  allows a redundant test to be eliminated and further specialization
  of the code for the unique needs of each iterator type.

* Created a reusable result tuple for iteritems().  Saves the malloc
  time for tuples when the previous result was not kept by client code
  (this is the typical use case for iteritems).  If the client code
  does keep the reference, then a new tuple is created.

Results in a 20% to 30% speedup depending on the size and sparsity
of the dictionary.
2004-03-18 02:41:19 +00:00
..
.cvsignore
abstract.c Add missing decref 2004-03-17 05:24:23 +00:00
boolobject.c
bufferobject.c Make buffer objects based on mutable objects (like array) safe. 2004-03-11 02:42:45 +00:00
cellobject.c
classobject.c - When method objects have an attribute that can be satisfied either 2003-11-22 23:55:50 +00:00
cobject.c Make CObjects mutable. Fixes #477441. 2003-10-19 18:30:01 +00:00
complexobject.c Simplify and speedup uses of Py_BuildValue(): 2003-10-12 19:09:37 +00:00
descrobject.c Use PyDict_Contains() instead of PySequence_Contains(). 2003-12-13 11:58:56 +00:00
dictnotes.txt Fix typos and add some elaborations 2004-03-15 15:52:22 +00:00
dictobject.c Optimize dictionary iterators. 2004-03-18 02:41:19 +00:00
enumobject.c Tidied up the implementations of reversed (including the custom ones 2004-03-10 10:10:42 +00:00
fileobject.c Remove support for --without-universal-newlines (see PEP 11). 2004-02-07 13:53:46 +00:00
floatobject.c Oops, didn't mean to commit the removal of float_compare! 2004-02-26 13:16:03 +00:00
frameobject.c Two forgotten Py_DECREF() for two out-of-memory conditions. 2004-01-27 16:08:07 +00:00
funcobject.c
intobject.c SF patch #875689: >100k alloc wasted on startup 2004-02-08 18:54:37 +00:00
iterobject.c
listobject.c Revert last change. Found an application that was worse off with resize 2004-03-15 09:01:31 +00:00
listsort.txt
longobject.c
methodobject.c * Added a new method flag, METH_COEXIST. 2003-12-13 11:26:12 +00:00
moduleobject.c
object.c Removed two unneeded lines from PyObject_Compare(). 2004-01-27 20:17:54 +00:00
obmalloc.c
rangeobject.c Tidied up the implementations of reversed (including the custom ones 2004-03-10 10:10:42 +00:00
setobject.c The copy module now handles sets directly. The __copy__ methods are no 2004-03-08 18:31:10 +00:00
sliceobject.c
stringobject.c [SF #866875] Add a specialized routine for one character 2004-01-05 00:29:51 +00:00
structseq.c
tupleobject.c Eliminate an unnecessary test on a common code path. 2004-03-15 00:16:34 +00:00
typeobject.c Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol 2004-02-08 04:21:26 +00:00
unicodectype.c Fix gcc 3.3 warnings related to Py_UNICODE_WIDE. 2003-12-29 01:36:01 +00:00
unicodeobject.c Fix reallocation bug in unicode.translate(): The code was comparing 2004-02-05 17:36:00 +00:00
unicodetype_db.h
weakrefobject.c Allocating a new weakref object can cause existing weakref objects for 2004-02-04 23:14:14 +00:00