aiida-core icon indicating copy to clipboard operation
aiida-core copied to clipboard

Prevent regressions in import time

Open danielhollas opened this issue 1 month ago • 0 comments

I guess the CI test we added a long time ago to catch these regressions is not doing its job. Guess it can be difficult to tune where we catch real significant regressions in performance but don't get hit by false positives all the time. Appreciate your effort to optimize this manually :+1:

Originally posted by @sphuber in https://github.com/aiidateam/aiida-core/pull/6382#pullrequestreview-2044575882

I spent some (too much?) time on optimizing the import time of the various aiida-core submodules --- the question is how do we make sure we don't regress?

We are already testing that unwanted modules are not loaded during verdi completion and verdi invocation. That's probably the most impactful for UX so it's great we have tests for that.

Perhaps we could expand the tests a little bit. For example a recent regression in aiida.orm import was caused by an import of aiida.storage from aiida.orm. Perhaps this is something we should test again as well, would be beneficial both in terms of import speed and in general to keep the various modules decoupled from each other.

(for example, right now aiida.cmdline is imported from aiida.orm which is not great from a design standpoint.

Besides automated tests, perhaps we could have a checklist of performance checks that should be done before each release.

danielhollas avatar May 13 '24 08:05 danielhollas