Skip to content

GH-131798: Optimize cached class attributes and methods in the JIT #134403

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 10 commits into from
May 22, 2025

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented May 21, 2025

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.

@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 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
{
// 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);
Copy link
Member

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.

@brandtbucher brandtbucher merged commit ec736e7 into python:main May 22, 2025
60 checks passed
lkollar pushed a commit to lkollar/cpython that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage sprint topic-JIT
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants