Skip to content
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

sys.settrace set some events without callbacks #117385

Closed
gaogaotiantian opened this issue Mar 30, 2024 · 0 comments
Closed

sys.settrace set some events without callbacks #117385

gaogaotiantian opened this issue Mar 30, 2024 · 0 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Mar 30, 2024

Bug report

Bug description:

sys.settrace sets PY_MONITORING_EVENT_BRANCH and PY_MONITORING_EVENT_EXCEPTION_HANDLED monitoring events but does not have any registered callbacks. Those two events should not generate any legacy trace events (and sys.settrace works fine without it for a long time), so we should just remove those.

This improves trace performance a bit (~3% for fib + empty tracefunc) as the events do not fire anymore.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant