Skip to content

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

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

Merged
merged 15 commits into from
Jul 26, 2025

Conversation

savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Jul 24, 2025

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

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

Copy link
Member

@tomasr8 tomasr8 left a comment

Choose a reason for hiding this comment

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

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
Copy link
Member

Fidget-Spinner commented Jul 24, 2025

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

Copy link
Member

@brandtbucher brandtbucher left a comment

Choose a reason for hiding this comment

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

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

@savannahostrowski
Copy link
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 savannahostrowski merged commit f7c380e into python:main Jul 26, 2025
64 checks passed
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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy