[Python-Dev] Joys of Optimization

Michael Hudson mwh at python.net
Fri Mar 12 08:28:04 EST 2004


Please stop posting HTML to this list!

"Raymond Hettinger" <raymond.hettinger at verizon.net> writes:

> In case you haven't been watching, we've been improving the heck out of
> looping, list operations, and list comprehensions.
>  
> Here is one of the scoresheets:
>  
> python timeit.py "[i for i in xrange(1000)]"
> py2.4   0.56 msec
> py2.3   1.16 msec
> py2.2   1.45 msec
>  
>  
> ymmv,

Not that much, actually (except that I have a faster machine than you
:-).  Nice work (particularly as the listresize reworking made no
detectable difference on this machine).

Just a couple of thoughts:

1) listextend_internal calls PyObject_Size twice, for no obvious
   reason.

2) It's a little odd that listextend_internal consumes a reference to
   b.  Perhaps a comment?

Cheers,
mwh

-- 
  Our Constitution never promised us a good or efficient government,
  just a representative one. And that's what we got.
      -- http://www.advogato.org/person/mrorganic/diary.html?start=109



More information about the Python-Dev mailing list