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. |