GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-109653: What's new: Note improved import times for several stdlib modules in Python 3.13 by AlexWaygood · Pull Request #118697 · python/cpython

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented May 7, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Closes #109653

  • Issue: Improve import time of various stdlib modules #109653

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danielhollas and ofek reacted with heart emoji
All reactions
  • ❤️ 2 reactions
@AlexWaygood
pythongh-109653: What's new: Note improved import times for several s…
a204e08
…tdlib modules in Python 3.13
@AlexWaygood
AlexWaygood requested a review from hugovk May 7, 2024 10:59
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news awaiting core review labels May 7, 2024
@bedevere-app bedevere-app Bot mentioned this pull request May 7, 2024
Improve import time of various stdlib modules #109653
Closed
@ambv
ambv enabled auto-merge (squash) May 7, 2024 11:04
hugovk
hugovk approved these changes May 7, 2024
View reviewed changes

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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%.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 7, 2024
@AlexWaygood

AlexWaygood commented May 7, 2024

Copy link
Copy Markdown
Member Author

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 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

hugovk commented May 7, 2024

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 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@AlexWaygood
ballpark figure for illustration
84d98e6
@AlexWaygood
AlexWaygood requested a review from hugovk May 7, 2024 11:17
hugovk
hugovk approved these changes May 7, 2024
View reviewed changes
@AlexWaygood
AlexWaygood enabled auto-merge (squash) May 7, 2024 11:34
@AlexWaygood
AlexWaygood merged commit 44a9f3d into python:main May 7, 2024
@AlexWaygood
AlexWaygood deleted the whatsnew-scoobydoo branch May 7, 2024 11:34
@bedevere-app bedevere-app Bot removed the awaiting merge label May 7, 2024
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
@AlexWaygood @SonicField
pythongh-109653: What's new: Note improved import times for several s…
fd73502
…tdlib modules in Python 3.13 (python#118697)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hugovk hugovk hugovk approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

docs Documentation in the Doc dir skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Improve import time of various stdlib modules

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@AlexWaygood @hugovk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.