[issue2607] why is (default)dict so slow on tuples???

Raymond Hettinger report at bugs.python.org
Sat Apr 12 06:20:20 CEST 2008


Raymond Hettinger <rhettinger at users.sourceforge.net> added the comment:

This discussion ought to be moved to comp.lang.python.  The timing 
script needs work.  It doesn't isolate any one issue for discussion.  
It is affected by GC, dict resizing, details of creating and hashing 
string objects, the need to periodically call the system malloc, etc. 

You get different results if:
* a new dictionary is created on each pass
* if any of the objects get reused
* if range(5) gets replaces with [0]*5
* if you use longs instead of ints
* if the strings are of fixed length:  str(j)[:5]

This is the wrong forum to explain every nuance of what affects 
performance and whether you think perl is better.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2607>
__________________________________


More information about the Python-bugs-list mailing list