Skip to content

typing.NewType docs: the future performance improvements are now in the past #105354

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 1 commit into from
Jun 7, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jun 6, 2023

Alternatively, as Serhiy suggested, we could just delete the bit in the existing .. versionchanged note that mentions the performance degradation in Python 3.10.


📚 Documentation preview 📚: https://cpython-previews--105354.org.readthedocs.build/

@AlexWaygood
Copy link
Member Author

@JelleZijlstra
Copy link
Member

My benchmarks for NT(1) where NT = NewType("NT", int):

  • 3.9: 48.2 ns
  • 3.10: 71.9 ns
  • 3.11: 31.3 ns

So this seems right.

@JelleZijlstra JelleZijlstra merged commit 5f65ff0 into python:main Jun 7, 2023
@miss-islington
Copy link
Contributor

Thanks @AlexWaygood for the PR, and @JelleZijlstra for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤄1�7

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 7, 2023
 1�7 the past (pythonGH-105354)

(cherry picked from commit 5f65ff0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@bedevere-bot
Copy link

GH-105414 is a backport of this pull request to the 3.12 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.12 only security fixes label Jun 7, 2023
@bedevere-bot
Copy link

GH-105415 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 Jun 7, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 7, 2023
 1�7 the past (pythonGH-105354)

(cherry picked from commit 5f65ff0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
JelleZijlstra pushed a commit that referenced this pull request Jun 7, 2023
 1�7 now in the past (GH-105354) (#105414)

`typing.NewType` docs: the future performance improvements are now in the past (GH-105354)
(cherry picked from commit 5f65ff0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
JelleZijlstra pushed a commit that referenced this pull request Jun 7, 2023
 1�7 now in the past (GH-105354) (#105415)

`typing.NewType` docs: the future performance improvements are now in the past (GH-105354)
(cherry picked from commit 5f65ff0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
@AlexWaygood
Copy link
Member Author

My benchmarks for NT(1) where NT = NewType("NT", int):

  • 3.9: 48.2 ns
  • 3.10: 71.9 ns
  • 3.11: 31.3 ns

So this seems right.

Yeah, I checked before filing the PR :)

@AlexWaygood AlexWaygood deleted the typing-newtype-docs branch June 7, 2023 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants