10000 gh-120144: Disable the CALL event when possible to achieve zero overhead pdb by gaogaotiantian · Pull Request #131390 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-120144: Disable the CALL event when possible to achieve zero overhead pdb #131390

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

Merged
merged 2 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/bdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,12 @@ def dispatch_call(self, frame, arg):
self.botframe = frame.f_back # (CT) Note that this may also be None!
return self.trace_dispatch
if not (self.stop_here(frame) or self.break_anywhere(frame)):
# No need to trace this function
# We already know there's no breakpoint in this function
# If it's a next/until/return command, we don't need any CALL event
# and we don't need to set the f_trace on any new frame.
# If it's a step command, it must either hit stop_here, or skip the
# whole module. Either way, we don't need the CALL event here.
self.disable_current_event()
return # None
# Ignore call events in generator except when stepping.
if self.stopframe and frame.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Disable ``CALL`` event in :mod:`bdb` in ``monitoring`` backend when we don't need any new events on the code object to get a better performance.
Loading
0