]> git.evergreen-ils.org Git - working/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)
committerMike Rylander <mrylander@gmail.com>
Tue, 5 May 2015 16:04:18 +0000 (12:04 -0400)
commit07c130ec8ae3f8aa21b185b3e5a3dfa4278a5bc9
tree5ffa6773901f88937582a9e86c0d7fced396e8f0
parentd5089b7b4065ed9cc51ffae441a22c99439a5da2
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>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm