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>