You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it's better for users to build their own helpers around that if they think this is useful. Generally speaking it's not a good idea to re-create the environment due to the parsing and compilation overhead of the template. It's better to stash it into a once_cell or similar. So API wise I do not want to encourage not reusing the environment.
In which situation is it preferrable to re-create the environment?
In which situation is it preferrable to re-create the environment?
Html generation takes around ~100 µs. I mean add_template + get_template + render.
While for my project even ~50ms is ok, because of this is GUI application with one user at time.
I don't see any reason to waste memory for Environment caching.
When "report" is not often used function there is no sense
to cache
Environment
between calls, so code to generatereports looks like this:
it would be nice to have function like
add_and_get_template
:The text was updated successfully, but these errors were encountered: