[issue26904] Difflib quick_ratio() could use Counter()

Michael Cuthbert report at bugs.python.org
Tue May 3 05:11:46 EDT 2016


Michael Cuthbert added the comment:

@wolma -- you're right, that the inplace __iand__ version of Counter is substantially faster -- it is still slower than the current code (since it is still basically a superset of it).  However, testing shows that it is close enough to the current code as to potentially be worth using it, in order to avoid the same issue that arose here (a small speed tweak in this code prevents it from taking advantage of larger improvements later).

If you think that is worth changing, I can make a new patch that incorporates it.  I don't have formal benchmarks on it, but quick tests show a 10% regression from the current speedups to using &= instead of the custom summation method.

----------

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


More information about the Python-bugs-list mailing list