-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
gh-118527: Intern code name and filename on default build #118576
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
Conversation
Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded build.
So to clarify, the risk here is that the default build will leak a bunch of names if code is created dynamically (by using How significant is the scaling improvement on the free-threading build? |
Honestly, I'm not too worried since we already intern names and constants and stuff. |
Do you have any numbers on how many extra strings this will intern? |
It's critical for some common patterns, although it's not the only critical bottleneck (there are other remaining bottlenecks too). For example: def run_in_parallel():
def foo():
pass
return foo If
Running before this PR: 19419 (in the default build, as reported by |
The increase from 19419 to 19721 doesn't seem so bad, but it depends on the baseline. Can you get numbers for something like the mypy benchmark or a similar "realistic" program? |
|
And |
I'm going to go ahead and merge this as the increase seems small, especially for larger programs. |
…on#118576) Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded build.
Interned and non-interned strings are treated differently by
marshal
, so be consistent between the default and free-threaded build.