Open Bug 1351374 Opened 7 years ago Updated 5 years ago

[meta] Don't instantiate Template renderer with each request

Categories

(bugzilla.mozilla.org :: General, task)

Production
task
Not set
normal

Tracking

()

People

(Reporter: emceeaich, Unassigned)

Details

Rebuilding templates with each request adds around a half second to each request.  

If we cache templates, we must make sure that cached templates do not leak information (PII, Group-only) to subsequent requests

The code changes for this are small, but require extensive manual QA or writing tests (which, ideally, should be done as we test)
Summary: [meta] Don't rebuild templates with each request → [meta] Don't instantiate Template renderer with each request
With a new template per request (current situation):

http http://bugzilla.vm/bmo/ --print h  0.27s user 0.05s system 48% cpu 0.663 total
http http://bugzilla.vm/bmo/ --print h  0.25s user 0.03s system 33% cpu 0.853 total

With proposed fix:

http http://bugzilla.vm/bmo/ --print h  0.24s user 0.03s system 87% cpu 0.316 total
http http://bugzilla.vm/bmo/ --print h  0.25s user 0.04s system 89% cpu 0.320 total
Did this go out under another bug?
Flags: needinfo?(dylan)
Nope, we're still this slow. We do precompile all templates at startup time, but we're still rebuilding the main handle on every request.
Flags: needinfo?(dylan)
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.