This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ggenellina
Recipients ggenellina, inducer
Date 2007-09-01.02:01:48
SpamBayes Score 0.27822265
Marked as misclassified No
Message-id <1188612109.5.0.491793802821.issue1045@psf.upfronthosting.co.za>
In-reply-to
Content
I've narrowed the problem to the usage of generator expressions. 
Generator expressions appear to be MUCH slower on 2.5 than on 2.4.

>python -m timeit "tuple([1 for _ in xrange(3)])"
2.4 -> 2.23us
2.5 -> 2.31us (a bit slower, but not so much)

>python -m timeit "tuple(1 for _ in xrange(3))"
2.4 -> 3.32us
2.5 -> 8.03us (240% slower than 2.4)

It appears to be a fixed cost, or startup cost, of the generator 
expression; differences get smaller when building large tuples (but 
always Python 2.5 runs slower than 2.4)
History
Date User Action Args
2007-09-01 02:01:50ggenellinasetspambayes_score: 0.278223 -> 0.27822265
recipients: + ggenellina, inducer
2007-09-01 02:01:49ggenellinasetspambayes_score: 0.278223 -> 0.278223
messageid: <1188612109.5.0.491793802821.issue1045@psf.upfronthosting.co.za>
2007-09-01 02:01:49ggenellinalinkissue1045 messages
2007-09-01 02:01:48ggenellinacreate