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

GH-90081: Run python tracers at full speed #95328

Merged
merged 5 commits into from
Jul 28, 2022

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jul 27, 2022

Since tracing is inactive when calling the tracer function, we can run Python tracers at full speed.

Significant slowdowns have been observed for Python tracers:
Specifically here: #90081 (comment)
and incidentally in #93516.

This is really easy to fix, we just set tstate->cframe->use_tracing = 0 if tstate->tracing != 0.

@python python deleted a comment Jul 27, 2022
@markshannon markshannon requested review from vstinner and removed request for iritkatriel July 27, 2022 13:45
Copy link
Member

@ericsnowcurrently ericsnowcurrently left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly LGTM

I've left a few minor comments. I think only the deleted blank line comment actually needs any change. Once that is sorted, feel free to merge.

Python/ceval.c Outdated Show resolved Hide resolved
Python/ceval.c Show resolved Hide resolved
Python/ceval.c Outdated Show resolved Hide resolved
Python/ceval.c Show resolved Hide resolved
@markshannon markshannon merged commit b8b2990 into python:main Jul 28, 2022
@miss-islington
Copy link
Contributor

Thanks @markshannon for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-95363 is a backport of this pull request to the 3.11 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Jul 28, 2022
@markshannon markshannon deleted the run-py-tracers-at-full-speed branch July 28, 2022 09:17
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 28, 2022
(cherry picked from commit b8b2990)

Co-authored-by: Mark Shannon <[email protected]>
pablogsal pushed a commit that referenced this pull request Jul 29, 2022
(cherry picked from commit b8b2990)

Co-authored-by: Mark Shannon <[email protected]>

Co-authored-by: Mark Shannon <[email protected]>
@vstinner
Copy link
Member

vstinner commented Aug 1, 2022

Is the pythoncapi-compat code correct in Python 3.10? https://github.com/python/pythoncapi-compat/blob/57aaa18053386142d1c93e26b201da15b86ad23b/pythoncapi_compat.h#L308-L336

On Python 3.11, it just uses the function coming from Python directly.

@markshannon
Copy link
Member Author

Yes, I think that is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants