Use normalized names to distinguish unique distributions for performance#317
Merged
Use normalized names to distinguish unique distributions for performance#317
Conversation
Contributor
|
This works super nicely, and locally I get a huge (nearly 10x) speedup 🎉 |
Member
Author
|
After further consideration, I do believe an OO solution may be better here... to allow a metadata provider to supply a fast version of the name normalization. |
… supply _normalized_name.
chrisjsewell
added a commit
to aiidateam/aiida-core
that referenced
this pull request
Aug 12, 2021
This commit replaces the use of `reentry`, for entry point loading, with `importlib_metadata` and, in turn, removes the requirement for users to run `reentry scan` after installations. aiida-core makes heavy use of entry-points to define plugins. The `reentry` package was introduced to load these plugins since, at the time, the de facto `pkg_resources` method for using entry points was too slow, in particular for responsive CLI usage. This, however, came with the drawback that users must perform an extra step to register the plugins before aiida-core can be used, or when new plugins are installed. In recent years `importlib.metadata` and its backport `importlib_metadata` has replaced `pkg_resources`, and as of python/importlib_metadata#317 is now on a par with `reentry` for performance. For now, we use `importlib_metadata` for all python versions, rather than the built-in (as of python 3.8) `importlib.metadata`, so that we can use the new python 3.10 API and performance boosts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #283.
@anntzer Please have a look.
I found I couldn't use
path.stembecausepathis aSimplePathand one implementation (zipfile.Path) doesn't implementstem.I don't trust our benchmarks. Can you determine if this change has the performance benefit you were expecting?