STINNER Victor <vstin...@python.org> added the comment:
I compared sorted(data, key=str.upper) performance between before the removal of the free list (parent of commit 3e54b575313c64f541e98216ed079fafed01ff5d) and the current master branch, I get: Mean +- std dev: [master] 167 us +- 4 us -> [cache] 179 us +- 7 us: 1.07x slower (+7%) I cannot reproduce the "70% slowdown". Raymond: How did you compile Python? What is your OS? How did you run your benchmark? --- It's a quick & dirty benchmark run. I didn't use LTO+PGO and I didn't isolate my CPU. Maybe the difference of 12 ns is just caused by the noise of my coarse benchmark procedure. I used commands: # master git checkout master git clean -fdx ./configure && make && ./python -m venv env && env/bin/python -m pip install pyperf env/bin/python -m pyperf timeit -s 'import random; data = [f"x{i}" for i in range(1000)]; random.shuffle(data)' 'sorted(data, key=str.upper)' -o ../master.json # before removal of the free list git checkout 3e54b575313c64f541e98216ed079fafed01ff5d^ git clean -fdx ./configure && make && ./python -m venv env && env/bin/python -m pip install pyperf env/bin/python -m pyperf timeit -s 'import random; data = [f"x{i}" for i in range(1000)]; random.shuffle(data)' 'sorted(data, key=str.upper)' -o ../master.json That's a Fedora 31 using GCC -O3 (GCC 9.3.1). -- The commit before the removal of the free list is: commit 76b645124b3aaa34bc664eece43707c01ef1b382 (HEAD) Date: Fri Jul 26 03:30:33 2019 +0200 Well, maybe I did a mistake. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39117> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com