-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Speed up exception handling by re-using Environments #7143
Conversation
test code from #7142 before: Before: cProfile data confirms jinja2 call times drop significantly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jogo, thanks for the PR! Please see my comments
if template in self.templates.keys(): | ||
env = Environment(loader=DictLoader(self.templates)) | ||
self.description: str = env.get_template(template).render( | ||
if template in self.env.list_templates(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since templates isn't updated only self.env
is (changed when adding extended_environment
to make the code less repetitive
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7143 +/- ##
=======================================
Coverage 95.88% 95.88%
=======================================
Files 834 834
Lines 82249 82253 +4
=======================================
+ Hits 78862 78868 +6
+ Misses 3387 3385 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Unclear what the issue is with the two failing CI jobs:
|
That must be unrelated - I'll look at that later on. LGTM - thank you again for the PR @jogo! |
Thank you @bblommers for the quick turnaround on this, much appreciated. |
Address #7142
By taking advantage of the caching logic in Environment