Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.1k
[mypyc] Inline fast paths of integer unboxing operations#17266
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
mypyc/lib-rt/pythonsupport.c Outdated
| } | ||
| } | ||
| /* Haven't lost any bits, but casting to long requires extra | ||
| * care (see comment above). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe copy the comment referred here for completeness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I wasn't sure what it referred to, so I just removed the reference to the comment.
This applies to
intand native integer types.This speeds up this micro-benchmark by up to 80% (it spends most of the time
unboxing integers):
The impact to compile time when self-compiling is below the noise floor. The generated
binary is about 0.1% larger. Since integer unboxing can be performance-critical,
this seems like a decent win.
Closesmypyc/mypyc#987. Work onmypyc/mypyc#757.