anta icon indicating copy to clipboard operation
anta copied to clipboard

refactor(anta): Optimize AntaTemplate render performance.

Open gmuloc opened this issue 1 year ago • 4 comments

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)

gmuloc avatar Apr 24 '24 21:04 gmuloc

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Apr 25 '24 08:04 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 25 '24 11:04 github-actions[bot]

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Apr 25 '24 12:04 github-actions[bot]

Conflicts have been resolved. A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 25 '24 12:04 github-actions[bot]