Author pitrou
Recipients arigo, gregory.p.smith, nnorwitz, phsilva, pitrou
Date 2008-03-27.16:56:14
SpamBayes Score 0.304442
Marked as misclassified No
Message-id <1206636975.34.0.33695206205.issue2459@psf.upfronthosting.co.za>
In-reply-to
Content
Armin, your patch gives a speed-up for "for" loops and comprehensions,
although a bit less. Also, it doesn't speed up "while" loops and "if"
statements at all. For some reasons it also appears to make pystone a
bit slower. Here are some micro-benchmarks:

./python -m timeit "for x in xrange(10000): pass"
Before: 1000 loops, best of 3: 758 usec per loop
After: 1000 loops, best of 3: 483 usec per loop

./python -m timeit "x=100" "while x: x -= 1"
Before: 10000 loops, best of 3: 21.8 usec per loop
After: 10000 loops, best of 3: 21.6 usec per loop

./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: 13.3 usec per loop

./python -m timeit -s "l = range(100)" "[x for x in l if x]"
Before: 10000 loops, best of 3: 23.9 usec per loop
After: 10000 loops, best of 3: 22.3 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.8 usec per loop
After: 100000 loops, best of 3: 13.9 usec per loop

./python Tools/pybench/pybench.py -t IfThenElse
Before: 164ms per round
After: 166ms per round
History
Date User Action Args
2008-03-27 16:56:15pitrousetspambayes_score: 0.304442 -> 0.304442
recipients: + pitrou, nnorwitz, arigo, gregory.p.smith, phsilva
2008-03-27 16:56:15pitrousetspambayes_score: 0.304442 -> 0.304442
messageid: <1206636975.34.0.33695206205.issue2459@psf.upfronthosting.co.za>
2008-03-27 16:56:14pitroulinkissue2459 messages
2008-03-27 16:56:14pitroucreate