-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mypyc] Some tagged integer micro-optimizations (#9801)
Use `PyLong_FromLong` instead of `PyLong_FromSsize_t` since it's faster (at least on Python 3.8) and happens to work the same on macOS and Linux. This is an extremely hot operation. Add some `unlikely(...)` and `likely(...)` to tagged integer primitives. Overall these made the Richards benchmark about 4% faster, which was a surprisingly big improvement. (I'm sure there are still some remaining easy performance wins in tagged integer operations.) Work on mypyc/mypyc#757.
- Loading branch information
Showing
1 changed file
with
27 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters