-
-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Scaling bottlenecks in the free-threaded build #118527
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
Labels
Comments
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 3, 2024
Most module names are interned and immortalized, but the `__main__` module was not. This partially addresses a scaling bottleneck in the free-threaded when creating closure concurrently in the main module.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 3, 2024
…odules This addresses a scaling bottleneck in the free-threaded build when calling functions like `math.floor()` concurrently from multiple threads.
colesbury
added a commit
that referenced
this issue
May 3, 2024
Most module names are interned and immortalized, but the main module was not. This partially addresses a scaling bottleneck in the free-threaded when creating closure concurrently in the main module.
colesbury
added a commit
that referenced
this issue
May 3, 2024
…#118529) This addresses a scaling bottleneck in the free-threaded build when calling functions like `math.floor()` concurrently from multiple threads.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 3, 2024
This interns the strings for `co_filename`, `co_name`, and `co_qualname` on codeobjects in the free-threaded build. This partially addresses a reference counting bottleneck when creating closures concurrently. The functions take the name and qualified name from the code object.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 4, 2024
Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded build.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 6, 2024
We already intern and immortalize most string constants. In the free-threaded build, other constants can be a source of reference count contention because they are shared by all threads running the same code objects.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 6, 2024
We already intern and immortalize most string constants. In the free-threaded build, other constants can be a source of reference count contention because they are shared by all threads running the same code objects.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 6, 2024
We already intern and immortalize most string constants. In the free-threaded build, other constants can be a source of reference count contention because they are shared by all threads running the same code objects.
colesbury
added a commit
that referenced
this issue
May 6, 2024
Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded build.
colesbury
added a commit
to colesbury/cpython
that referenced
this issue
May 6, 2024
colesbury
added a commit
that referenced
this issue
May 7, 2024
We already intern and immortalize most string constants. In the free-threaded build, other constants can be a source of reference count contention because they are shared by all threads running the same code objects.
These are fixed now |
SonicField
pushed a commit
to SonicField/cpython
that referenced
this issue
May 8, 2024
…118528) Most module names are interned and immortalized, but the main module was not. This partially addresses a scaling bottleneck in the free-threaded when creating closure concurrently in the main module.
SonicField
pushed a commit
to SonicField/cpython
that referenced
this issue
May 8, 2024
…odules (python#118529) This addresses a scaling bottleneck in the free-threaded build when calling functions like `math.floor()` concurrently from multiple threads.
SonicField
pushed a commit
to SonicField/cpython
that referenced
this issue
May 8, 2024
…python#118558) This interns the strings for `co_filename`, `co_name`, and `co_qualname` on codeobjects in the free-threaded build. This partially addresses a reference counting bottleneck when creating closures concurrently. The closures take the name and qualified name from the code object.
SonicField
pushed a commit
to SonicField/cpython
that referenced
this issue
May 8, 2024
…on#118576) Interned and non-interned strings are treated differently by `marshal`, so be consistent between the default and free-threaded build.
SonicField
pushed a commit
to SonicField/cpython
that referenced
this issue
May 8, 2024
…8667) We already intern and immortalize most string constants. In the free-threaded build, other constants can be a source of reference count contention because they are shared by all threads running the same code objects.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are a few remaining scaling bottlenecks in the free-threaded build that we should fix.
I have been using the following benchmark to detect bottlenecks that were previously issues in older versions of the nogil forks:
https://gist.github.com/colesbury/429fe9f90036d43ad43576c3d357a12e
Note that for reliable results the above benchmark requires some setup:
NTHREADS
if necessary on your systemtaskset -c 0-<N>
to choose separate physical cores)Current bottlenecks
Underlying issues
PyCodeObject
.func.__qualname__
orcode.co_qualname
(when creating closure)PyCFunctionObjects
Linked PRs
_Py_ID(__main__)
for main module name #118528The text was updated successfully, but these errors were encountered: