gh-118527: Intern code name and filename on default build - #118576
Conversation
Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded 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 fooIf
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 |
…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.