-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mypyc + bidict #1045
Comments
Is running a benchmark under (warmed up) PyPy and comparing to interpreted CPython predictive (to a crude approximation) of whether mypyc would enable a significant speedup? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I just noticed that https://github.com/python/mypy/tree/master/mypyc#development-status-and-roadmap says:
I recently experimented with using mypyc to compile a hot loop that I extracted from the bidict code (please click that link to see the changes, which are straightforward and should be easy to follow), benchmarked in CI (under cachegrind as per Itamar), and got some unexpected results:
I expected that running the mypyc-compiled version of this hot loop would be much faster than running the interpreted version for affected benchmarks, and certainly not significantly slower for any benchmarks. But I did not see any speedup, and many benchmarks ran slower (e.g. the two quoted above got more than 10% slower).
Not sure if this is due to a gap in mypyc, or if there's just not much mypyc could ever do to make this code run faster. I'd love to look at this with a mypyc expert. Hopefully it's still possible to ship a much faster release of bidict thanks to mypyc, and unlock potential for other projects in the process.
Thanks for maintaining mypyc!
The text was updated successfully, but these errors were encountered: