Skip to content

[mypyc] Make native attribute writes faster with free threading - #21748

Draft
JukkaL wants to merge 8 commits into
masterfrom
mypyc-safe-attr-3
Draft

[mypyc] Make native attribute writes faster with free threading#21748
JukkaL wants to merge 8 commits into
masterfrom
mypyc-safe-attr-3

Conversation

@JukkaL

@JukkaL JukkaL commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

WIP: This is a prototype created using Codex, which looks faster for attribute set in a micro-benchmark, since we don't do delayed decref. I still need to measure impact to self check and review manually. I will be on vacation for ~2 weeks and wanted to get this out for others to have a look.

@JukkaL
JukkaL marked this pull request as draft July 18, 2026 13:01
@JukkaL

JukkaL commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator Author

@msullivan This is a potentially faster way to implement memory safe attribute access.

@JukkaL
JukkaL force-pushed the mypyc-safe-attr-3 branch from 371864e to 54f5644 Compare August 19, 2026 14:06
@JukkaL

JukkaL commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

I measured the impact to self-check, and on Linux/AMD Ryzen, this improves performance by about 2.7%, and on macOS/M1 Pro performance improves by about 2.3%. In microbenchmarks performance impact is all over the place and on Apple Silicon they were slower on average, but I trust the self check benchmark more.

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.

1 participant