Louie Lu added the comment: I can now only test on Python3.6, providing much meaningful sentence, still trying to use perf on cpython master branch.
--------------------------------------------------- $ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其乎哀哉"*1000' -- 's.find("乎")' Median +- std dev: 228 ns +- 7 ns $ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其乎哀哉"*1000' -- 's.find("乏")' Median +- std dev: 143 ns +- 3 ns --------------------------------------------------- $ python -m perf timeit -s 's="一件乒乓事事亏, 不乏串連产業, 万丈一争今为举, 其哀哉"*1000' -- 's.find("乎")' ^^ (missing "乎") Median +- std dev: 100 us +- 3 us $ python -m perf timeit -s 's="一件乒乓事事亏, 不串連产業, 万丈一争今为举, 其乎哀哉"*1000' -- 's.find("乏")' ^^ (missing "乏") Median +- std dev: 1.67 us +- 0.05 us ---------- nosy: +louielu _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24821> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com