Author pitrou
Recipients gregory.p.smith, pitrou
Date 2008-03-26.23:09:25
SpamBayes Score 0.00533627
Marked as misclassified No
Message-id <1206572972.64.0.591363840229.issue2459@psf.upfronthosting.co.za>
In-reply-to
Content
This new patch completes the bytecode modifications. For/while loops as
well as list comprehensions and generator expressions are a bit faster
now. Also, as a side effect I've introduced a speed improvement for "if"
statements and expressions...

Some micro-benchmarks (completing the ones already given above):

./python Tools/pybench/pybench.py -t IfThenElse
Before: 167ms per round
After: 136ms per round

./python -m timeit -s "y=range(100)" "sum(x for x in y)"
Before: 10000 loops, best of 3: 20.4 usec per loop
After: 100000 loops, best of 3: 17.9 usec per loop

./python -m timeit -s "y=range(100)" "sum(x for x in y if x)"
Before: 10000 loops, best of 3: 28.5 usec per loop
After: 10000 loops, best of 3: 23.3 usec per loop

./python -m timeit -s "y=range(100)" "sum(x for x in y if not x)"
Before: 100000 loops, best of 3: 16.4 usec per loop
After: 100000 loops, best of 3: 12.1 usec per loop

./python -m timeit -s "x,y,z=1,2,3" "x if y else z"
Before: 1000000 loops, best of 3: 0.218 usec per loop
After: 10000000 loops, best of 3: 0.159 usec per loop

A couple of tests seem to be failing in obscure ways in the test suite,
I'll try to examine them. Most of the test suite runs fine though.
History
Date User Action Args
2008-03-26 23:09:32pitrousetspambayes_score: 0.00533627 -> 0.00533627
recipients: + pitrou, gregory.p.smith
2008-03-26 23:09:32pitrousetspambayes_score: 0.00533627 -> 0.00533627
messageid: <1206572972.64.0.591363840229.issue2459@psf.upfronthosting.co.za>
2008-03-26 23:09:31pitroulinkissue2459 messages
2008-03-26 23:09:30pitroucreate