Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.14] gh-91048: Refactor and optimize remote debugging module (#134652)#134673

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 1 commit intopython:3.14frompablogsal:backport-42b25ad-3.14
May 25, 2025

Conversation

pablogsal
Copy link
Member

@pablogsalpablogsal commentedMay 25, 2025
edited by github-actionsbot
Loading

Completely refactor Modules/_remote_debugging_module.c with improved code organization, replacing scattered reference counting and error handling with centralized goto error paths. This cleanup improves maintainability and reduces code duplication throughout the module while preserving the same external API.

Implement memory page caching optimization in Python/remote_debug.h to avoid repeated reads of the same memory regions during debugging operations. The cache stores previously read memory pages and reuses them for subsequent reads, significantly reducing system calls and improving performance.

Add code object caching mechanism with a new code_object_generation field in the interpreter state that tracks when code object caches need invalidation. This allows efficient reuse of parsed code object metadata and eliminates redundant processing of the same code objects across debugging sessions.

Optimize memory operations by replacing multiple individual structure copies with single bulk reads for the same data structures. This reduces the number of memory operations and system calls required to gather debugging information from the target process.

Update Makefile.pre.in to include Python/remote_debug.h in the headers list, ensuring that changes to the remote debugging header force proper recompilation of dependent modules and maintain build consistency across the codebase.

Also, make the module compatible with the free threading build as an extra :)

Co-authored-by: Łukasz Langalukasz@langa.pl

(cherry picked from commit42b25ad)


📚 Documentation preview 📚:https://cpython-previews--134673.org.readthedocs.build/

…#134652)Completely refactor Modules/_remote_debugging_module.c with improvedcode organization, replacing scattered reference counting and errorhandling with centralized goto error paths. This cleanup improvesmaintainability and reduces code duplication throughout the module whilepreserving the same external API.Implement memory page caching optimization in Python/remote_debug.h toavoid repeated reads of the same memory regions during debuggingoperations. The cache stores previously read memory pages and reusesthem for subsequent reads, significantly reducing system calls andimproving performance.Add code object caching mechanism with a new code_object_generationfield in the interpreter state that tracks when code object caches needinvalidation. This allows efficient reuse of parsed code object metadataand eliminates redundant processing of the same code objects acrossdebugging sessions.Optimize memory operations by replacing multiple individual structurecopies with single bulk reads for the same data structures. This reducesthe number of memory operations and system calls required to gatherdebugging information from the target process.Update Makefile.pre.in to include Python/remote_debug.h in the headerslist, ensuring that changes to the remote debugging header force properrecompilation of dependent modules and maintain build consistency acrossthe codebase.Also, make the module compatible with the free threading build as an extra :)Co-authored-by: Łukasz Langa <lukasz@langa.pl>(cherry picked from commit42b25ad)
@pablogsal
Copy link
MemberAuthor

Checked with the 3.14 release manager for backport ✅

@pablogsalpablogsal merged commit1822f33 intopython:3.14May 25, 2025
46 checks passed
@pablogsalpablogsal deleted the backport-42b25ad-3.14 branchMay 25, 2025 22:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@encukouencukouAwaiting requested review from encukouencukou is a code owner

@ericsnowcurrentlyericsnowcurrentlyAwaiting requested review from ericsnowcurrentlyericsnowcurrently is a code owner

@markshannonmarkshannonAwaiting requested review from markshannonmarkshannon is a code owner

@1st11st1Awaiting requested review from 1st11st1 is a code owner

@asvetlovasvetlovAwaiting requested review from asvetlovasvetlov is a code owner

@kumaraditya303kumaraditya303Awaiting requested review from kumaraditya303kumaraditya303 is a code owner

@willingcwillingcAwaiting requested review from willingcwillingc is a code owner

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aaslanderlend-aasland is a code owner

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@pablogsal

[8]ページ先頭

©2009-2025 Movatter.jp