Message367567
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. |
|
Date |
User |
Action |
Args |
2020-04-28 21:49:27 | vstinner | set | recipients:
+ vstinner, rhettinger, benjamin.peterson, methane, serhiy.storchaka, pablogsal |
2020-04-28 21:49:27 | vstinner | set | messageid: <1588110567.29.0.648965172409.issue39117@roundup.psfhosted.org> |
2020-04-28 21:49:27 | vstinner | link | issue39117 messages |
2020-04-28 21:49:27 | vstinner | create | |
|