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 cached class attributes and methods in the JIT by brandtbucher · Pull Request #134403 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented May 21, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This handles _LOAD_ATTR_CLASS, _LOAD_ATTR_NONDESCRIPTOR_WITH_VALUES, _LOAD_ATTR_NONDESCRIPTOR_NO_DICT, _LOAD_ATTR_METHOD_WITH_VALUES, _LOAD_ATTR_METHOD_NO_DICT, and _LOAD_ATTR_METHOD_LAZY_DICT.

Also: clean up a few things I ran into while working on this, and document our symbol lattice.

  • 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
brandtbucher added 6 commits May 20, 2025 23:30
@brandtbucher
Optimize (and peephole away) cached attributes
54dedf6
@brandtbucher
blurb add
b7d8c03
@brandtbucher
Add a test for _LOAD_ATTR_METHOD_LAZY_DICT
844299c
@brandtbucher
fixup
c83acf9
@brandtbucher
Add link back
bb5e18e
@brandtbucher
fixup
0e20c44
@brandtbucher
brandtbucher requested a review from tomasr8 May 21, 2025 04:07
@brandtbucher brandtbucher self-assigned this May 21, 2025
@brandtbucher brandtbucher added the performance Performance or resource usage label May 21, 2025
@brandtbucher
brandtbucher requested a review from Fidget-Spinner as a code owner May 21, 2025 04:07
@brandtbucher brandtbucher added the sprint label May 21, 2025
@brandtbucher
brandtbucher requested a review from markshannon as a code owner May 21, 2025 04:07
@brandtbucher brandtbucher added interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-JIT labels May 21, 2025
@bedevere-app bedevere-app Bot mentioned this pull request May 21, 2025
Better uop coverage in the JIT optimizer #131798
Open
@bedevere-app bedevere-app Bot added the awaiting core review label May 21, 2025
Fidget-Spinner
Fidget-Spinner reviewed May 21, 2025
View reviewed changes
Comment thread Python/optimizer_analysis.c
{
// The cached value may be dead, so we need to do the lookup again... :(
if (type && PyType_Check(type)) {
PyObject *lookup = _PyType_Lookup(type, name);

@Fidget-Spinner Fidget-Spinner May 21, 2025

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.

Well this is sad, I would've hoped pure would be able to handle this. But yeah we need to look up again.

Sorry, something went wrong.

Uh oh!

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

brandtbucher reacted with confused emoji
All reactions
  • 😕 1 reaction
brandtbucher added 3 commits May 21, 2025 16:50
@brandtbucher
Revert the _LOAD_SMALL_INT stuff.
d490347
@brandtbucher
Add tests
58017a8
@brandtbucher
make regen-cases
1d2f546
tomasr8
tomasr8 approved these changes May 21, 2025
View reviewed changes
@brandtbucher
Catch up with main
0202451
@brandtbucher
brandtbucher merged commit ec736e7 into python:main May 22, 2025
@bedevere-app bedevere-app Bot removed the awaiting core review label May 22, 2025
lkollar pushed a commit to lkollar/cpython that referenced this pull request May 26, 2025
@brandtbucher @lkollar
pythonGH-131798: Optimize cached class attributes and methods in the …
f2c44b4
…JIT (pythonGH-134403)
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@brandtbucher @Pranjal095
pythonGH-131798: Optimize cached class attributes and methods in the …
0df7fcf
…JIT (pythonGH-134403)
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@brandtbucher @taegyunkim
pythonGH-131798: Optimize cached class attributes and methods in the …
d88083b
…JIT (pythonGH-134403)
gostak-dd pushed a commit to gostak-dd/cpython that referenced this pull request Jun 2, 2026
@brandtbucher @gostak-dd
pythonGH-131798: Optimize cached class attributes and methods in the …
adc4893
…JIT (pythonGH-134403)
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 left review comments
@tomasr8 tomasr8 tomasr8 approved these changes
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

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

Assignees

@brandtbucher brandtbucher

Labels

interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage sprint 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.

3 participants

@brandtbucher @tomasr8 @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.