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

Various speedups for verdi cmdline #2315

Merged

Conversation

giovannipizzi
Copy link
Member

@giovannipizzi giovannipizzi commented Dec 6, 2018

Fixes #376 and fixes #2261

In particular when completing tests.
Thanks to @ltalirz
This fixes #376 (again...).
Fixes include:

  • using a new instance of the reentry manager that prevents
    automatic reentry scans
  • removed unuseful with_dbenv decorators from 'verdi devel tests' and
    from the TestModuleParamType of click
  • prevent unnecessary imports of plumpy that is a bit slow to import

Also, we fixed the place where AIIDADB_PROFILE is set in the
main verdi click command, to set it also when a default
profile is used (this was probably the reason of the unneeded
with_dbenv calls)

In particular when completing tests.
Thanks to @ltalirz
This fixes aiidateam#376 (again...).
Fixes include:
- using a new instance of the reentry manager that prevents
  automatic reentry scans
- removed unuseful with_dbenv decorators from 'verdi devel tests' and
  from the TestModuleParamType of click
- prevent unnecessary imports of plumpy that is a bit slow to import

Also, we fixed the place where AIIDADB_PROFILE is set in the
main `verdi` click command, to set it also when a default
profile is used (this was probably the reason of the unneeded
with_dbenv calls)
@giovannipizzi giovannipizzi requested a review from ltalirz December 6, 2018 22:16
@giovannipizzi
Copy link
Member Author

Note: the time went down from

real	0m1.487s
user	0m0.863s
sys	0m0.602s

to

real	0m0.258s
user	0m0.164s
sys	0m0.085s

The plugin manager is now always using the same
global reentry manager (that does NOT automatically
re-run `reentry scan`).
Now if one runs
```
verdi -p aaa setup bbb
```
`aaa` is ignored and a profile `bbb` is used.

Moreover, a default profile is set (if none is set yet)
also when running non-interactively (that is what quicksetup does).
This fixes aiidateam#2261
(and does not impact performance for TAB-completion)
@giovannipizzi
Copy link
Member Author

Tests pass now @ltalirz

ltalirz
ltalirz previously approved these changes Dec 7, 2018
Copy link
Member

@ltalirz ltalirz left a comment

Choose a reason for hiding this comment

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

I am Leopold Talirz and I approve this PR.

Moreover, small fixes to the .gitignore
@sphuber sphuber merged commit 453f500 into aiidateam:provenance_redesign Dec 7, 2018
@coveralls
Copy link

coveralls commented Dec 8, 2018

Coverage Status

Coverage decreased (-0.004%) to 68.932% when pulling cecd1db on giovannipizzi:fix_376_slow_verdi into 818888f on aiidateam:provenance_redesign.

@giovannipizzi giovannipizzi deleted the fix_376_slow_verdi branch April 16, 2019 10:43
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.

4 participants