[issue28243] Performance regression in functools.partial()
STINNER Victor
report at bugs.python.org
Mon Mar 6 07:59:34 EST 2017
STINNER Victor added the comment:
Oh wait, there was a major regression in my perf module :-( The --compare-to option was completely broken in the development branch (but it works for timeit --compare-to in the latest release). It's now fixed! So please ignore results of my previous comment.
New benchmark, 3.6 compared to 3.5:
haypo at smithers$ ./python -m perf timeit -s 'from functools import partial; f = lambda x, y: None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to ../3.5/python --python-names=ref:patch --python-names=3.5:3.6
3.5: ..................... 152 ns +- 4 ns
3.6: ..................... 152 ns +- 1 ns
Median +- std dev: [3.5] 152 ns +- 4 ns -> [3.6] 152 ns +- 1 ns: 1.00x faster (-0%)
Not significant!
=> Ah! No change, it's still not significant! Same speed.
3.7 compared to 3.6:
haypo at smithers$ ./python -m perf timeit -s 'from functools import partial; f = lambda x, y: None; g = partial(f, 1)' 'g(2)' --duplicate=100 --compare-to ../3.6/python --python-names=ref:patch --python-names=3.6:3.7
3.6: ..................... 152 ns +- 1 ns
3.7: ..................... 138 ns +- 1 ns
Median +- std dev: [3.6] 152 ns +- 1 ns -> [3.7] 138 ns +- 1 ns: 1.10x faster (-9%)
=> Oh! 3.7 is 1.10x faster! I didn't compile Python with PGO, so maybe it's a minor change due to code placement? At least, it's not slower ;-)
I'm unable to see any performance slowdown in 3.6 compared to 3.5, so I keep the issue closed.
Anyway, thanks for the report Serhiy! Our performance watcher ;-)
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28243>
_______________________________________
More information about the Python-bugs-list
mailing list