Skip to content
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

Don't try to follow imports to encodings.* #10094

Merged
merged 2 commits into from Feb 15, 2021
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Feb 15, 2021

encodings uses module-level __getattr__. By not trying to follow
imports to the submodules, resolving imports is slightly faster.

This is usually pretty marginal, but there can be over 100 suppressed
submodules, so this may actually be significant.

`encodings` uses module-level `__getattr__`.  By not trying to follow
imports to the submodules, resolving imports is slightly faster.

This is usually pretty marginal, but there can be over 100 suppressed
submodules, so this may actually be significant.
all_suppressed = {module for module in all_suppressed if module not in graph}
all_suppressed = {module
for module in all_suppressed
if module not in graph and not module.startswith('encodings.')}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe make this a top level constant (i.e. a single item list or set), so later we can skip similar "special" modules?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll define a function that contains the check (as a micro-optimization and it also allows other checks than starts with).

@JukkaL JukkaL merged commit 2738c73 into master Feb 15, 2021
@JukkaL JukkaL deleted the daemon-fast-imports-2 branch February 15, 2021 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants