Michael Cuthbert added the comment: I've tried to get the system to not be slower on small sets by not creating a Counter for less than 60 items, and managed to get within 10% of the speed for small sequences while maintaining the 3-3.6x speedup for big comparisons and testing that the results were unchanged, but the code just became far too unmanageable for such a small function as quick_ratio, with code forking that would be hard to maintain.
I'll upload the stub of the replacement for quick_ratio for future developments, in case the creation of Counter objects (the bottleneck) ever disappears, in which case this code will be simpler and faster than the current implementation, but until then, I think it's best to close this issue. ---------- resolution: -> later stage: patch review -> resolved status: open -> closed Added file: https://bugs.python.org/file47125/newQuickRatio.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue26904> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com