Brandt Bucher <brandtbuc...@gmail.com> added the comment:

Hm, that benchmark seems really noisy. Looking at your code, it appears that 
you aren't actually iterating over the results.

I've attached a version of your benchmark rewritten to use pyperf. Here are the 
results on a system with a fresh PGO/LTO build of CPython main, run with CPU 
isolation:

(py) bucher@is-bucher-p1:~/src/patmaperformance$ sudo $(which pyperf) system 
tune > /dev/null
(py) bucher@is-bucher-p1:~/src/patmaperformance$ sudo $(which python) 
if_match.py --rigorous
.........................................
if: Mean +- std dev: 2.16 ms +- 0.13 ms
.........................................
match: Mean +- std dev: 2.13 ms +- 0.07 ms

It appears that there is no significant difference between the two (which is 
what I expect, given the current implementation). With that said, our work in 
issue 44283 will likely have a significant impact for cases like this.

----------
Added file: https://bugs.python.org/file50083/if_match.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44276>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to