Skip to content

gh-67565: remove redundant C-contiguity checks #105521

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 33 commits into from
Oct 23, 2023

Conversation

furkanonder
Copy link
Contributor

@furkanonder furkanonder commented Jun 8, 2023

@furkanonder furkanonder added the performance Performance or resource usage label Aug 5, 2023
@furkanonder furkanonder changed the title GH-67565: remove redundant C-contiguity check in getargs.c gh-67565: remove redundant C-contiguity check in getargs.c Aug 5, 2023
@furkanonder
Copy link
Contributor Author

CC: @vstinner

@vstinner
Copy link
Member

cc @serhiy-storchaka

@serhiy-storchaka
Copy link
Member

It looks like the original old Stefan's patch. But currently most functions use Argument Clinic which copied a code from getargs.c, so now there are a lot of PyBuffer_IsContiguouss in the generated code. Argument Clinic should be updated too. And there are unneeded contiguity tests in other code: #67565 (comment).

@furkanonder furkanonder changed the title gh-67565: remove redundant C-contiguity check in getargs.c gh-67565: remove redundant C-contiguity checks Sep 10, 2023
@furkanonder
Copy link
Contributor Author

@ericsnowcurrently Thank you very much for your valuable feedbacks. I've made some changes. Can you review it again?

@erlend-aasland
Copy link
Contributor

@furkanonder, can you resolve the conflict, please?

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM. I have minor suggestion for tests.

Since this PR adds new tests, I think that it is better to split it on two parts:

  1. Tests only. This change will be backported to 3.12 and 3.11 to avoid regressions.
  2. Other changes. So we can be sure that they do not affect the user code.

@furkanonder furkanonder added the 3.13 bugs and security fixes label Oct 17, 2023
@erlend-aasland
Copy link
Contributor

cc. @ericsnowcurrently, who requested changes.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

LGTM.

@serhiy-storchaka
Copy link
Member

Thank you for your contribution, Furkan. It took a long time because I wasn't sure it was completely safe. But I hope the new tests will catch the bug if we are wrong.

@furkanonder
Copy link
Contributor Author

@serhiy-storchaka You're welcome.

aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
@furkanonder furkanonder removed the 3.13 bugs and security fixes label Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance or resource usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants