Message277755
Oh, your message reminded me that I always wanted an option in the timeit module to run the benchmark on two Python versions and then directly compare the result. I just added the feature to perf and then I released perf 0.7.11, enjoy! The output is more compact and it's more reliable because the comparison ensures that the difference is significant.
---
$ export PYTHONPATH=~/prog/GIT/perf
$ ./python-resize -m perf timeit --inherit-environ=PYTHONPATH --compare-to=./python-ref -s 'x = range(1000); d={}' 'for i in x: d[i]=i; del d[i];' --rigorous
python-ref: ........................................ 77.6 us +- 1.8 us
python-resize: ........................................ 74.8 us +- 1.9 us
Median +- std dev: [python-ref] 77.6 us +- 1.8 us -> [python-resize] 74.8 us +- 1.9 us: 1.04x faster
---
I can reproduced the 4% speedup.
(I didn't review the patch yet.) |
|
Date |
User |
Action |
Args |
2016-09-30 14:45:42 | vstinner | set | recipients:
+ vstinner, rhettinger, methane, serhiy.storchaka, xiang.zhang |
2016-09-30 14:45:42 | vstinner | set | messageid: <1475246742.83.0.983169851517.issue28199@psf.upfronthosting.co.za> |
2016-09-30 14:45:42 | vstinner | link | issue28199 messages |
2016-09-30 14:45:42 | vstinner | create | |
|