Author pitrou
Recipients gregory.p.smith, pitrou
Date 2008-03-26.02:09:46
SpamBayes Score 0.118044
Marked as misclassified No
Message-id <1206497392.57.0.156258590526.issue2459@psf.upfronthosting.co.za>
In-reply-to
Content
This new patch also updates the code generation for list comprehensions.
Here are some micro-benchmarks:

./python -m timeit -s "l = range(100)" "[x for x in l]"
Before: 100000 loops, best of 3: 14.9 usec per loop
After: 100000 loops, best of 3: 12.5 usec per loop

./python -m timeit -s "l = range(100)" "[x for x in l if x]"
Before: 10000 loops, best of 3: 24.1 usec per loop
After: 100000 loops, best of 3: 18.8 usec per loop

./python -m timeit -s "l = range(100)" "[x for x in l if not x]"
Before: 100000 loops, best of 3: 15.5 usec per loop
After: 100000 loops, best of 3: 11.9 usec per loop

Please note that this patch is orthogonal with Neal's patch in #2183, so
the two combined should be quite interesting for the list comprehensions
bytecode.
History
Date User Action Args
2008-03-26 02:09:53pitrousetspambayes_score: 0.118044 -> 0.118044
recipients: + pitrou, gregory.p.smith
2008-03-26 02:09:52pitrousetspambayes_score: 0.118044 -> 0.118044
messageid: <1206497392.57.0.156258590526.issue2459@psf.upfronthosting.co.za>
2008-03-26 02:09:51pitroulinkissue2459 messages
2008-03-26 02:09:51pitroucreate