Skip to content

gh-109653: What's new: Note improved import times for several stdlib modules in Python 3.13 - #118697

Merged
AlexWaygood merged 2 commits into
python:mainfrom
AlexWaygood:whatsnew-scoobydoo
May 7, 2024
Merged

gh-109653: What's new: Note improved import times for several stdlib modules in Python 3.13#118697
AlexWaygood merged 2 commits into
python:mainfrom
AlexWaygood:whatsnew-scoobydoo

Conversation

@AlexWaygood

@AlexWaygoodAlexWaygood commented May 7, 2024

Copy link
Copy Markdown
Member

@AlexWaygood
AlexWaygood requested a review from hugovkMay 7, 2024 10:59
@bedevere-appbedevere-appBot added docs Documentation in the Doc dir skip news awaiting core review labels May 7, 2024
@ambv
ambv enabled auto-merge (squash) May 7, 2024 11:04

@hugovkhugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be nice to include some numbers if appropriate, maybe as a range?

Something like:

 * Several standard library modules have had their import times significantly
- improved.+ improved, from around XX% to YY%.

@AlexWaygood

Copy link
Copy Markdown
MemberAuthor

Would be nice to include some numbers if appropriate, maybe as a range?

I'll add some ballpark figures.

I'm slightly wary of being too precise, because you'll only e.g. enjoy the typing import speedup if you've also avoided importing contextlib and re (and anything that might import contextlib and re) elsewhere in your code. If you're writing a small CLI tool where startup times are really important, it's more likely that you're already being careful about that kind of thing, so it's more likely you'll see an improvement. But as soon as you e.g. import asyncio, it's game over.

@hugovk
hugovk disabled auto-merge May 7, 2024 11:13
@hugovk

Copy link
Copy Markdown
Member

Yep, a rough ballpark is perfect. As you say, this really helps CLIs rather than big apps or libraries. People who really care can click through to the PRs to see the full details.

@AlexWaygood
AlexWaygood requested a review from hugovkMay 7, 2024 11:17
@AlexWaygood
AlexWaygood enabled auto-merge (squash) May 7, 2024 11:34
@AlexWaygood
AlexWaygood merged commit 44a9f3d into python:mainMay 7, 2024
@AlexWaygood
AlexWaygood deleted the whatsnew-scoobydoo branch May 7, 2024 11:34
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve import time of various stdlib modules

2 participants

@AlexWaygood@hugovk