-
Notifications
You must be signed in to change notification settings - Fork 192
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
Faster aiida imports #6092
Closed
Closed
Faster aiida imports #6092
Conversation
This file contains 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
These class attributes require a look up whether the `Node` class has a registered entry point which can have a non-negligible cost. These attributes were defined in the `AbstractNodeMeta` class, which is the metaclass of the `Node` class, which would cause this code to be executed as soon as the class was imported. Here, the `AbstractNodeMeta` metaclass is removed. The `_plugin_type_string` and `_query_type_string` class attributes are changed to class properties. The actual value is stored in the private attribute analog which is defined lazily the first time the property is accessed.
The module 'aiida.manage.external.postgres' is only imported in certain verdi commands so it does not make sense to always import it. It also doesn't need to be a public API I guess.
This call has quadratic complexity so we want to avoid calling it as much as possible.
@danielhollas since we are in the process of merging these changes in other PRs, can this be closed? |
@sphuber I'd prefer to keep it open for a while longer as a reference to see what has been merged and what remains. |
I don't see how keeping this PR open helps with that, but ok |
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.
This is a PR showcasing my
faster-import
branch, as desribed in detail on Discourse topic.https://aiida.discourse.group/t/why-is-aiidalab-base-widget-import-so-slow/32
This is not really meant to be merged, since there are a lot of changes, it will be easier to review by submitting individual PRs.
This first one is in #6091.
Also there were some exploratory changes that might not be needed / desirable in the end.