improve operation deserialization speed
Explanation of changes
The locate method is expensive in the deserialization of an Operation. This PR uses the standard functools.lru_cache to cache the result.
The number of items in the cache is small, so there is no need to manage clearing the cache.
Merge checklist
See also merge request guidelines
-
Merge request has been reviewed and approved by a project maintainer. -
Merge request contains a clear description of the proposed changes and the issue it addresses. -
Merge request made onto appropriate branch (develop for most MRs). -
New code is fully tested. -
New code is documented and docstrings use numpydoc format. -
CHANGELOG.rstandAUTHORS.rsthave been updated (when applicable). -
CI pipelines pass -
pre-commit run --all-files --hook-stage commitpasses (gitlab-ci), - test suite passes (gitlab-ci),
- no degradation in code-coverage (codacy),
- no (serious) new pylint code quality issues introduced (codacy),
- documentation builds successfully (CI and readthedocs),
-
windows tests pass (manually triggered by maintainers before merging).
-
For reference, the issues workflow is described in the contribution guidelines.
Edited by Pieter Eendebak