Skip to content

Conversation

@markshannon
Copy link
Member

@markshannon markshannon commented Jun 9, 2021

This reduces the C stack consumption of _PyEval_EvalFrameDefault a bit.

Also fixes a subtle bug when tracing is turned on in the middle of the line, and the last traced line was after the current line.
Previously, this resulting in tracing the current line, as the interpreter perceived this as a backwards branch. Which was wrong.

This PR fixes it by making the decision of whether to trace based solely on the current instruction and the last one executed (in the same frame).

https://bugs.python.org/issue44348

@markshannon markshannon force-pushed the move-trace-info-to-thread-state branch from d254683 to aadd103 Compare June 9, 2021 12:32
@markshannon markshannon closed this Jun 9, 2021
@markshannon markshannon reopened this Jun 9, 2021
Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

The first part of the change moving PyTraceInfo into thread state and the following refactoring LGTM. Thanks.

I don't have the expertise to verify the second part about the subtle tracing bug.

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.

LGTM

@mattip
Copy link
Contributor

mattip commented Jun 20, 2021

Do these performance enhancement PRs have microbenchmarks that show the improvements?

@markshannon markshannon deleted the move-trace-info-to-thread-state branch January 6, 2022 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants