[issue18594] C accelerator for collections.Counter is slow

Raymond Hettinger report at bugs.python.org
Mon Sep 30 06:28:47 CEST 2013


Raymond Hettinger added the comment:

A C-accelerator should ALWAYS be able to beat a pure python version if it does the same steps but without the overhead of the eval-loop.  And in special cases such as type(self)==Counter, it can do much better.

To resolve this report, the C accelerator needs to be fixed.  As Stefan pointed-out, the fast-path isn't being triggered because of PyDict_CheckExact test.  And, the fallback path can be sped-up as well (by doing the same steps in C as are being done with the pure python code).

----------
stage:  -> needs patch
versions: +Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18594>
_______________________________________


More information about the Python-bugs-list mailing list