Skip to content

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

Merged
JelleZijlstra merged 1 commit intopython:mainfrom
AlexWaygood:typing-newtype-docs
Jun 7, 2023
Merged

typing.NewType docs: the future performance improvements are now in the past#105354
JelleZijlstra merged 1 commit intopython:mainfrom
AlexWaygood:typing-newtype-docs

Conversation

@AlexWaygood
Copy link
Copy Markdown
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
Copy Markdown
Member Author

@JelleZijlstra
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

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

(cherry picked from commit 5f65ff0)

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

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
Copy Markdown

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
… 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
… 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
… 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
Copy Markdown
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