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

[3.11] GH-93516: Speedup line number checks when tracing. (GH-93763) #94023

Closed
wants to merge 1 commit into from

Conversation

markshannon
Copy link
Member

  • Use a lookup table to reduce overhead of getting line numbers during tracing.

Backport of #93763

)

* Use a lookup table to reduce overhead of getting line numbers during tracing.
@markshannon
Copy link
Member Author

markshannon commented Jun 20, 2022

The ABI breakage is not really a break, as the new field is inserted (almost) at the end, after any other fields used in C extensions.

@@ -278,6 +279,7 @@ def generate_code(self, name: str, code: types.CodeType) -> str:
self.write(f".co_name = {co_name},")
self.write(f".co_qualname = {co_qualname},")
self.write(f".co_linetable = {co_linetable},")
self.write("._co_linearray = NULL,")
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, unrelated question, but does this mean I need to add the field from my _co_code change here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically, no. C will initialize any fields not explicitly mentioned to zero.
I think it is good practice to be explicit, though.

@pablogsal
Copy link
Member

I will regenerate the ABI in this PR

@pablogsal
Copy link
Member

@markshannon I cannot push to the remote repo, could you please ensure the "allow pushes from maintainers checkbox is activated on the right column"?

@markshannon
Copy link
Member Author

There is no "allow pushes from maintainers" checkbox.
Could you make a PR on this branch?

@markshannon
Copy link
Member Author

Closing in favour of #94127 to allow edits.

@markshannon markshannon deleted the backport-93763 branch September 26, 2023 12:49
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.

4 participants