]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1449709: Persist template processor for speed
authorMike Rylander <mrylander@gmail.com>
Mon, 4 May 2015 21:06:54 +0000 (17:06 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 10 Jun 2015 17:34:28 +0000 (13:34 -0400)
commitbc55788c14222f5b40db418d5faa841350dd42c5
tree351c74727f216cd1e1fc872a5fdc2d20047384d1
parent10426dffb768ac9176fa06d7c023cc38c1730f2c
LP#1449709: Persist template processor for speed

By persisting the Template Toolkit processor object per
vhost/locale/context-loader/xml-strictness instead
of creating a new one for every request, we allow TT
to maintain an in-memory cache of all the templates it
has compiled.  This increases speed by as much as 80%.

In addition, we reduce the number of times the TPAC checks
for the existance of a template by remembering the state
of the first readability probe.  This is most important
on systems where the templates are stored on NFS, where
stat(2) system calls can be particularly expensive.

We now pass the Apache object ($r) to the template processor
instead of relying on tied-STDOUT behaviour, because each
request gets a new tied file handle.  After the first one,
it's the wrong one.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm