[issue41835] Speed up dict vectorcall creation using keywords

Marco Sulla report at bugs.python.org
Sat Oct 24 08:47:25 EDT 2020


Marco Sulla <launchpad.net at marco.sulla.e4ward.com> added the comment:

I commented out sqlalchemy in the requirements.txt in the pyperformance source code, and it worked. I had also to skip tornado:

pyperformance run -r -b,-sqlalchemy_declarative,-sqlalchemy_imperative,-tornado_http -o ../perf_master.json

This is my result:

pyperformance compare perf_master.json perf_dict_init.json -O table | grep Significant
| 2to3                    | 356 ms           | 348 ms              | 1.02x faster | Significant (t=7.28)   |
| fannkuch                | 485 ms           | 468 ms              | 1.04x faster | Significant (t=9.68)   |
| pathlib                 | 22.5 ms          | 22.1 ms             | 1.02x faster | Significant (t=13.02)  |
| pickle_dict             | 29.0 us          | 30.3 us             | 1.05x slower | Significant (t=-92.36) |
| pickle_list             | 4.55 us          | 4.64 us             | 1.02x slower | Significant (t=-10.87) |
| pyflate                 | 735 ms           | 702 ms              | 1.05x faster | Significant (t=6.67)   |
| regex_compile           | 197 ms           | 193 ms              | 1.02x faster | Significant (t=2.81)   |
| regex_v8                | 24.5 ms          | 23.9 ms             | 1.02x faster | Significant (t=17.63)  |
| scimark_fft             | 376 ms           | 386 ms              | 1.03x slower | Significant (t=-15.07) |
| scimark_lu              | 154 ms           | 158 ms              | 1.03x slower | Significant (t=-12.94) |
| sqlite_synth            | 3.35 us          | 3.21 us             | 1.04x faster | Significant (t=17.65)  |
| telco                   | 6.54 ms          | 7.14 ms             | 1.09x slower | Significant (t=-8.51)  |
| unpack_sequence         | 58.8 ns          | 61.5 ns             | 1.04x slower | Significant (t=-19.66) |

It's strange that some benchmarks are slower, since the patch only do two additional checks to dict_vectorcall. Maybe they use many little dicts?

@methane:
> Would you implement some more optimization based on your PR to demonstrate your idea?

I already done them, I'll do a PR.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41835>
_______________________________________


More information about the Python-bugs-list mailing list