1. 18 Mar, 2004 3 commits
    • Raymond Hettinger's avatar
      Optimize dictionary iterators. · 019a148c
      Raymond Hettinger authored
      * 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.
      019a148c
    • Brett Cannon's avatar
      Minor grammatical fixes. · 65d63424
      Brett Cannon authored
      65d63424
    • Brett Cannon's avatar
      Extremely minor typo fixed. · 9b976e66
      Brett Cannon authored
      9b976e66
  2. 17 Mar, 2004 4 commits
  3. 16 Mar, 2004 4 commits
  4. 15 Mar, 2004 5 commits
  5. 14 Mar, 2004 4 commits
    • Raymond Hettinger's avatar
      Add missing docstrings. · deb4da50
      Raymond Hettinger authored
      deb4da50
    • Raymond Hettinger's avatar
      list_resize() now has an "exact" option for bypassing the overallocation · 0e91643b
      Raymond Hettinger authored
      scheme in situations that likely won't benefit from it.  This further
      improves memory utilization from Py2.3 which always over-allocates
      except for PyList_New().
      
      Situations expected to benefit from over-allocation:
          list.insert(), list.pop(), list.append(), and list.extend()
      
      Situations deemed unlikely to benefit:
          list_inplace_repeat, list_ass_slice, list_ass_subscript
      
      The most gray area was for listextend_internal() which only runs
      when the argument is a list or a tuple.  This could be viewed as
      a one-time fixed length addition or it could be viewed as wrapping
      a series of appends.  I left its over-allocation turned on but
      could be convinced otherwise.
      0e91643b
    • Raymond Hettinger's avatar
      SF feature request #686323: Minor array module enhancements · 49f9bd15
      Raymond Hettinger authored
      array.extend() now accepts iterable arguments implements as a series
      of appends.  Besides being a user convenience and matching the behavior
      for lists, this the saves memory and cycles that would be used to
      create a temporary array object.
      49f9bd15
    • Raymond Hettinger's avatar
      Update the array overallocation scheme to match the approach used for · 6e2ee866
      Raymond Hettinger authored
      lists.  Speeds append() operations and reduces memory requirements
      (because of more conservative overallocation).
      
      Paves the way for the feature request for array.extend() to support
      arbitrary iterable arguments.
      6e2ee866
  6. 13 Mar, 2004 7 commits
  7. 12 Mar, 2004 6 commits
  8. 11 Mar, 2004 7 commits