Eric Snow added the comment:

Without too many optimzations, the C implementation of OrderedDict is basically 
between 1x and 4x the performance of raw dict.  This contrasts with the pure 
Python OrderedDict, which falls in roughly between 4x and 100x.

I've attached an addition to pybench, not intended to be committed, that 
compares the 3.  Run any of these commands to get timing:

  ./python Tools/pybench/pybench.py -t ODict
  ./python Tools/pybench/pybench.py -t ODict -t _Py
  ./python Tools/pybench/pybench.py -t ODict -t _C
  ./python Tools/pybench/pybench.py -t ODict -t _Dict

I tuned the # rounds for each test such that the raw dict results all come out 
to just about the same value (2ms on my computer).  That way it's easy to 
compare the pure Python or C results to the dict results.

----------
Added file: http://bugs.python.org/file30461/odict-speed.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16991>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to