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

GH-132732: Use pure op machinery to optimize `COMPARE_OP_INT/FLOAT/STR` by savannahostrowski · Pull Request #137062 · python/cpython · GitHub

Repository navigation

GH-132732: Use pure op machinery to optimize COMPARE_OP_INT/FLOAT/STR - #137062

Merged
savannahostrowski merged 15 commits into
python:mainfrom
savannahostrowski:constant_compare
Jul 26, 2025
Merged

savannahostrowski merged 15 commits into
python:mainfrom
savannahostrowski:constant_compare

Conversation

savannahostrowski commented Jul 24, 2025 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Member

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

Awesome work! This LGTM, just a few nits for the comments.

tomasr8 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

LGTM :) just one question: this also adds the _POP_TWO_LOAD_CONST_INLINE_BORROW optimization to other ops like _BINARY_OP_ADD_FLOAT and others. Is it worth to add tests for these ops as well?
Essentially something like test_compare_op_float_pop_two_load_const_inline_borrow but adapted for _BINARY_OP_ADD_FLOAT, etc.. This would mean adding quite a few tests so I'm not sure if it makes sense.

Co-authored-by: Ken Jin <kenjin4096@gmail.com>

Fidget-Spinner commented Jul 24, 2025 •
edited
Loading

Copy link
Copy Markdown
Member

Let's leave it open for a few more days in case someone else wants to leave any comments, then merge it!

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

This is great! I'd love to see it extended (later) to handle even more cases.

Copy link
Copy Markdown
Member Author

Chatted with Brandt and I think I'm going to land this PR as is. I plan to go back and do a pass to add more optimizations with _POP_TWO_LOAD_CONST_INLINE_BORROW, _POP_TOP_LOAD_CONST_INLINE_BORROW, etc. elsewhere.

savannahostrowski merged commit f7c380e into python:main Jul 26, 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.

4 participants


Back | FazBrowse Home | New Git URL