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 Ignore a bunch of generated files. 2000-05-02 18:34:30 +00:00
abstract.c Add missing decref 2004-03-17 05:24:23 +00:00
boolobject.c - bool() called without arguments now returns False rather than 2003-04-19 18:15:10 +00:00
bufferobject.c Make buffer objects based on mutable objects (like array) safe. 2004-03-11 02:42:45 +00:00
cellobject.c Use new GC API. 2001-08-29 23:54:21 +00:00
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 SF bug #753451: classmethod abuse --> SystemError 2003-06-18 01:13:41 +00:00
intobject.c SF patch #875689: >100k alloc wasted on startup 2004-02-08 18:54:37 +00:00
iterobject.c Whitespace normalization. 2003-06-25 13:12:18 +00:00
listobject.c Revert last change. Found an application that was worse off with resize 2004-03-15 09:01:31 +00:00
listsort.txt Fixed new typos, added a little info about ~sort versus "hint"s. 2002-08-10 07:04:01 +00:00
longobject.c SF patch 703666: Several objects don't decref tmp on failure in subtype_new 2003-06-28 20:04:25 +00:00
methodobject.c * Added a new method flag, METH_COEXIST. 2003-12-13 11:26:12 +00:00
moduleobject.c Remove code that tried to warn about shadowing builtin names after a 2003-07-16 22:04:11 +00:00
object.c Removed two unneeded lines from PyObject_Compare(). 2004-01-27 20:17:54 +00:00
obmalloc.c Whitespace normalization. 2003-06-17 15:48:11 +00:00
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 SF bug #800796: Difference between hash() and __hash__() 2003-09-05 14:27:30 +00:00
stringobject.c [SF #866875] Add a specialized routine for one character 2004-01-05 00:29:51 +00:00
structseq.c Removed all uses of the out-of-favor __safe_for_unpickling__ magic 2003-02-01 02:16:37 +00:00
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 Add unidata_version. Bump generator version number. 2002-11-25 09:13:37 +00:00
weakrefobject.c Allocating a new weakref object can cause existing weakref objects for 2004-02-04 23:14:14 +00:00