FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-131798: Optimize `_UNARY_NEGATIVE` by noamcohen97 · Pull Request #135223 · python/cpython · GitHub

Repository navigation

gh-131798: Optimize _UNARY_NEGATIVE - #135223

Merged
Fidget-Spinner merged 10 commits into
python:mainfrom
noamcohen97:optimize-unary-negate
Jun 23, 2025
Merged

Fidget-Spinner merged 10 commits into
python:mainfrom
noamcohen97:optimize-unary-negate

Conversation

noamcohen97 commented Jun 6, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Comment thread Python/optimizer_bytecodes.c Outdated

brandtbucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Looks good, just some suggested improvements. Thanks!

Comment thread Python/optimizer_bytecodes.c Outdated
Comment thread Python/optimizer_bytecodes.c Outdated

Copy link
Copy Markdown
Contributor Author

Thanks for the review! @brandtbucher @Zheaoli

brandtbucher left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Awesome! Can you just fix the merge conflict in the test file?

Copy link
Copy Markdown
Contributor Author

Done!

Copy link
Copy Markdown
Member

@noamcohen97 sorry it seems there's merge conflicts again from merging your other PR.

Copy link
Copy Markdown
Contributor Author

@Fidget-Spinner I should have seen this coming 😄

Copy link
Copy Markdown
Member

@noamcohen97 sorry I forgot to merge this in time and seems there's conflicts again 🤦 . Could you please merge in main again? I'll make sure to remember to merge it soon this time.

Fidget-Spinner self-assigned this Jun 23, 2025
noamcohen97 requested a review from tomasr8 as a code owner June 23, 2025 18:46
noamcohen97 force-pushed the optimize-unary-negate branch from 72c83d8 to 517d7ef Compare June 23, 2025 18:47

Copy link
Copy Markdown
Contributor Author

@Fidget-Spinner seems like _UNARY_NEGATIVE already got optimized in #135668 without considering float value and non-compact integer values.
I suggest we replace the current implementation with this one. WDYT?

Copy link
Copy Markdown
Member

@noamcohen97 sounds good. Just make sure to use compact ints. Thanks!

Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks!

Fidget-Spinner merged commit bda1218 into python:main Jun 23, 2025
noamcohen97 deleted the optimize-unary-negate branch June 23, 2025 19:42
AndPuQing pushed a commit to AndPuQing/cpython that referenced this pull request Jul 11, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
This file contains hidden or 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL