Message282187
I rewrote bench_builtins.py to use my new perf module.
Python 3.7 is between 1.27x and 1.42x faster than Python 3.6, but sorted(list) is slower. I don't know why sorted(list) is slower. It doesn't use a key function, and so should not be impacted by FASTCALL changes made since Python 3.6.
Benchmark results of Python 3.7 (include latest FASTCALL patches) compared to Python 3.5 (no FASTCALL):
filter(lambda x: x, range(1000)): Median +- std dev: [3.5] 126 us +- 7 us -> [3.7] 94.6 us +- 4.8 us: 1.34x faster (-25%)
map(lambda x, y: x+y, range(1000), range(1000)): Median +- std dev: [3.5] 163 us +- 10 us -> [3.7] 115 us +- 7 us: 1.42x faster (-30%)
map(lambda x: x, range(1000)): Median +- std dev: [3.5] 115 us +- 6 us -> [3.7] 90.9 us +- 5.4 us: 1.27x faster (-21%)
sorted(list): Median +- std dev: [3.5] 17.5 us +- 1.0 us -> [3.7] 19.7 us +- 1.1 us: 1.12x slower (+12%)
sorted(list, key=lambda x: x): Median +- std dev: [3.5] 122 us +- 10 us -> [3.7] 91.8 us +- 5.7 us: 1.33x faster (-25%)
Note: you need the development version of perf to run the script (future version 0.9.2). |
|
Date |
User |
Action |
Args |
2016-12-01 15:39:41 | vstinner | set | recipients:
+ vstinner, rhettinger, pitrou, scoder, ezio.melotti, python-dev, serhiy.storchaka, yselivanov, jstasiak, Demur Rumed |
2016-12-01 15:39:41 | vstinner | set | messageid: <1480606781.84.0.855538874697.issue23507@psf.upfronthosting.co.za> |
2016-12-01 15:39:41 | vstinner | link | issue23507 messages |
2016-12-01 15:39:41 | vstinner | create | |
|