GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131798: optimize through keyword and bound method calls in the JIT by kumaraditya303 · Pull Request #148466 · python/cpython

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Apr 12, 2026 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Better uop coverage in the JIT optimizer #131798

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kumaraditya303
optimize CALL_KW_PY
d653515
@kumaraditya303
kumaraditya303 requested review from Fidget-Spinner, markshannon, savannahostrowski and tomasr8 as code owners April 12, 2026 19:09
@bedevere-app bedevere-app Bot added the awaiting core review label Apr 12, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Apr 12, 2026
Better uop coverage in the JIT optimizer #131798
Open
@kumaraditya303 kumaraditya303 added the skip news label Apr 12, 2026
Fidget-Spinner
Fidget-Spinner reviewed Apr 13, 2026
View reviewed changes
Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
fixup and add test
f28b5e0
@kumaraditya303
kumaraditya303 requested a review from Fidget-Spinner April 13, 2026 11:00
@kumaraditya303
add recording to CALL_KW_BOUND_METHOD
c5d5d75
Fidget-Spinner
Fidget-Spinner reviewed Apr 13, 2026
View reviewed changes
Comment thread Lib/test/test_capi/test_opt.py Outdated

def test_call_kw(self):
def func(a):
return 42 * a

@Fidget-Spinner Fidget-Spinner Apr 13, 2026

Copy link
Copy Markdown
Member

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.

We should be checking that we optimize through the trace. So the best way is to put a global (e.g. range) here and check if it gets promoted in the tests below. See for example test_init_resolves_callable which does self.assertNotIn("_LOAD_GLOBAL_BUILTINS", uops). Same for the other test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kumaraditya303
check _LOAD_GLOBAL_BUILTINS in test
c82e57d
@Fidget-Spinner

Fidget-Spinner commented Apr 13, 2026

Copy link
Copy Markdown
Member

It's not optimizing through the bound method because we're missing _EXPAND_METHOD_KW in the JIT. I think you can just copy whatever _EXPAND_METHOD has and place it under there.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner Fidget-Spinner changed the title gh-131798: optimize CALL_KW_PY in the JIT gh-131798: optimize through keyword and bound method calls in the JIT Apr 13, 2026
Fidget-Spinner added 3 commits April 13, 2026 20:42
@Fidget-Spinner
Cover _EXPAND_METHOD_KW as well
b436dd0
@Fidget-Spinner
Merge branch 'jit-calls' of github.com:kumaraditya303/cpython into pr…
75c5bb1
…/148466
@Fidget-Spinner
add comment
9f394e9
Fidget-Spinner
Fidget-Spinner approved these changes Apr 13, 2026
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

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.

Thanks! This should be a pretty decent win.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Apr 13, 2026
@Fidget-Spinner
Fidget-Spinner merged commit 88e378c into python:main Apr 13, 2026
78 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 13, 2026
@kumaraditya303
kumaraditya303 deleted the jit-calls branch April 13, 2026 15:11
@kumaraditya303 kumaraditya303 added the topic-JIT label Apr 16, 2026
ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
@kumaraditya303 @Fidget-Spinner @ljfp
pythongh-131798: optimize through keyword and bound method calls in t…
ff5f784
…he JIT (pythonGH-148466)

Co-authored-by: Ken Jin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Fidget-Spinner Fidget-Spinner Fidget-Spinner approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@tomasr8 tomasr8 Awaiting requested review from tomasr8 tomasr8 is a code owner
@savannahostrowski savannahostrowski Awaiting requested review from savannahostrowski

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news topic-JIT

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@kumaraditya303 @Fidget-Spinner
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.