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 mark.dickinson
Recipients mark.dickinson, pitrou, rhettinger
Date 2009-02-08.17:03:09
SpamBayes Score 7.395629e-09
Marked as misclassified No
Message-id <1234112591.73.0.448787736371.issue5186@psf.upfronthosting.co.za>
In-reply-to
Content
Here are some timings for dict creation, created with the attached script.  
They're not particularly scientific, but they at least show that this one-
line optimization can make a significant difference.

Typical results on my machine (OS X 10.5.6/Intel), 32-bit non-debug build 
of the trunk (r69442):  before

dict creation (selected):  1.95572495461
dict creation (shuffled):  1.98964595795
dict creation:  1.78589916229

and after:

dict creation (selected):  1.7055079937   # (14% speedup)
dict creation (shuffled):  1.5843398571   # (25% speedup)
dict creation:  1.32362794876             # (34% speedup)

BTW, all tests pass on my machine with this patch applied.
History
Date User Action Args
2009-02-08 17:03:11mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, pitrou
2009-02-08 17:03:11mark.dickinsonsetmessageid: <1234112591.73.0.448787736371.issue5186@psf.upfronthosting.co.za>
2009-02-08 17:03:10mark.dickinsonlinkissue5186 messages
2009-02-08 17:03:09mark.dickinsoncreate