-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
Reorder some fields to facilitate out-of-process inspection #106140
Comments
I have requested to @Yhg1s to back port this to 3.12 and he agreed |
…pection Signed-off-by: Pablo Galindo <[email protected]>
…pection Signed-off-by: Pablo Galindo <[email protected]>
#106143) Signed-off-by: Pablo Galindo <[email protected]>
…pection (pythonGH-106143) (cherry picked from commit 2d5a1c2) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
…pection (pythonGH-106143) (cherry picked from commit 2d5a1c2) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
…spection (GH-106143) (#106147) gh-106140: Reorder some fields to facilitate out-of-process inspection (GH-106143) (cherry picked from commit 2d5a1c2) Signed-off-by: Pablo Galindo <[email protected]> Co-authored-by: Pablo Galindo Salgado <[email protected]>
…-process inspection (pythonGH-106148) (cherry picked from commit 9126a6a) Co-authored-by: Pablo Galindo Salgado <[email protected]>
…-process inspection (pythonGH-106148) (cherry picked from commit 9126a6a) Co-authored-by: Pablo Galindo Salgado <[email protected]> Signed-off-by: Pablo Galindo <[email protected]>
Did you benchmark these changes? This might benefit a few tool authors, but a slowdown hurts everyone. |
Yes, I ran pyperformance in my local server with isolated CPUs and saw no measurable performance changes at all so this should be safe. |
Some of the relevant fields in the interpreter state and the frame state in 3.12 are very challenging to fetch from out of process tools because they are in offsets that depend on compilation or platform variables that are different in different platforms. Not only that but they require the tools to copy a huge amount of intermediate structures making the whole thing very verbose.
As an example, this is the list of stuff that needs to be copied so out-of-process debuggers can fetch the interpreters, runtime state and thread list:
https://gist.github.com/godlygeek/271951b20bb4c3783c2dd7c80908b116
With a simple reordering, that would shrink this to
https://gist.github.com/godlygeek/341ce879a638c0fece9d0081d63e5ad9
For the interpreter state is also quite bad. Here is the things that need to be copied:
https://gist.github.com/godlygeek/2468ff3d0f648a1aca7a8305bad7f825
Not only that, but this depends on the compile-time value of all of this:
If the user changes any of these (like
WITH_PYMALLOC_RADIX_TREE
) when compiling Python, then the tools won't be able to work correctly.We can easily reorder these two structures because they are not in the hot path of anything (unlike frames and code objects).
Linked PRs
The text was updated successfully, but these errors were encountered: