Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GH-115776: Allow any fixed sized object to have inline values#123192

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

markshannon
Copy link
Member

@markshannonmarkshannon commentedAug 21, 2024
edited
Loading

Currently only objects withPy_TYPE(obj)->tp_basicsize == sizeof(PyObject) are allowed to have inline values.
This PR changes that to allow any object where all instances of the class have the same size to have inline values.

Performance is in the noise, but thestats show a clear reduction in the number ofLOAD_ATTRs executed.
Oddly, the number ofLOAD_ATTR_INSTANCE_VALUEs executed is roughly unchanged, the new specializations being for class attributes. Fixingthe shadowing issue should improve things further and show an increase inLOAD_ATTR_INSTANCE_VALUEs.

Copy link
Member

@iritkatrieliritkatriel left a comment

Choose a reason for hiding this comment

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

Is this stuff documented anywhere?

@markshannon
Copy link
MemberAuthor

Is this stuff documented anywhere?

Good point.

@markshannonmarkshannon merged commita4fd7aa intopython:mainAug 21, 2024
57 checks passed
@hauntsaninja
Copy link
Contributor

It looks like this PR broke a test in the mypyc transpiler:python/mypy#17973
I suspect it's something funky when callingPyObject_SetAttr(obj, "__dict__", {"x": 10})

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@iritkatrieliritkatrieliritkatriel approved these changes

@Fidget-SpinnerFidget-SpinnerAwaiting requested review from Fidget-SpinnerFidget-Spinner is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@markshannon@hauntsaninja@iritkatriel

[8]ページ先頭

©2009-2025 Movatter.jp