anta
anta copied to clipboard
refactor(anta): Optimize AntaTemplate render performance.
Description
Builds on top of:
- #648
- #650
Adds:
- cprofile decorator around
anta.runner.main - a singleton with Args for AntaTemplate - https://gist.github.com/wowkin2/3af15bfbf197a14a2b0b2488a1e8c787
- This allows to have one unique object shared across test with a given set of input to render AntaCommand rather than one per test we use => save memory
- this allows to create the custom params for the template on init and reuse it everytime => save lots of time not calling create_model
Fixes #647
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have run pre-commit for code linting and typing (
pre-commit run) - [x] I have made corresponding changes to the documentation
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes (
tox -e testenv)
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.