Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 35.2k
gh-146640: Optimize int operations by mutating uniquely-referenced operands in place (JIT only)#146641
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
Uh oh!
There was an error while loading. Please reload this page.
gh-146640: Optimize int operations by mutating uniquely-referenced operands in place (JIT only) #146641
Changes from all commits
befeded964bb34f33b452654ae93af5b4c99d13a2346b6cca63c13174d6288b73b9a453fb1e6c771022660b81bee0bae6276e0785File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Optimize compact integer arithmetic in the JIT by mutating | ||
| uniquely-referenced operands in place, avoiding allocation of a new int | ||
| object. Speeds up the pyperformance ``spectral_norm`` benchmark by ~10%. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
Shouldn't this be ERROR_IF instead? The only way this can be null after the compactlong_add operation is that it fails?
Same for below.
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.
The non-inplace
_BINARY_OP_ADD_INTusesEXIT_IFas well. The_PyCompactLong_Addcan error for two reasons: OOM and the result of the add being non-compact (e.g. requiring more than one digit). I think for the latter we want theEXIT_IF?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.
oh yeah that's fine then ok. thanks!