[Koha-devel] Speed improvement & T::T

Mike Hafen mdhafen at tech.washk12.org
Fri Dec 9 20:42:37 CET 2011


Perhaps the way to overcome permissions would be to host the pre-compiled
template files in git, or create them just before creating the archives for
releases.

2011/12/9 Chris Nighswonger <cnighswonger at foundations.edu>

> Nice work Paul!
>
> I think this is worth at least a try to see what improvement may be gained.
>
> I wonder if permissions will be an issue here?
>
> Kind Regards,
> Chris
>
>
> On Fri, Dec 9, 2011 at 9:13 AM, Paul Poulain <paul.poulain at biblibre.com>wrote:
>
>> Hello Koha-devel,
>>
>> As I said during last IRC chat, I'm focusing on performance improvement
>> those weeks.
>> I've digged into Template::Toolkit, and here
>>
>> http://search.cpan.org/~abw/Template-Toolkit-2.22/lib/Template/Manual/Config.pod#Caching_and_Compiling_Options
>> I've found 2 options that look promizing : COMPILE_EXT and COMPILE_DIR
>>
>> The loading of the template seems to cost 150ms, and I feel that those 2
>> options could be usefull to speed up the process. Did anyone already saw
>> this option before ? Is it something worth investigating more ?
>>
>> Here is the documentation of the 1st option:
>>
>> COMPILE_EXT
>>
>> From version 2 onwards, the Template Toolkit has the ability to compile
>> templates to Perl code and save them to disk for subsequent use (i.e.
>> cache persistence). The COMPILE_EXT option may be provided to specify a
>> filename extension for compiled template files. It is undefined by
>> default and no attempt will be made to read or write any compiled
>> template files.
>>
>>    my $template = Template->new({
>>        COMPILE_EXT => '.ttc',
>>    });
>>
>> If COMPILE_EXT is defined (and COMPILE_DIR isn't, see below) then
>> compiled template files with the COMPILE_EXT extension will be written
>> to the same directory from which the source template files were loaded.
>>
>> Compiling and subsequent reuse of templates happens automatically
>> whenever the COMPILE_EXT or COMPILE_DIR options are set. The Template
>> Toolkit will automatically reload and reuse compiled files when it finds
>> them on disk. If the corresponding source file has been modified since
>> the compiled version as written, then it will load and re-compile the
>> source and write a new compiled version to disk.
>>
>> This form of cache persistence offers significant benefits in terms of
>> time and resources required to reload templates. Compiled templates can
>> be reloaded by a simple call to Perl's require(), leaving Perl to handle
>> all the parsing and compilation. This is a Good Thing.
>> --
>> Paul POULAIN
>> http://www.biblibre.com
>> Expert en Logiciels Libres pour l'info-doc
>> Tel : (33) 4 91 81 35 08
>> _______________________________________________
>> Koha-devel mailing list
>> Koha-devel at lists.koha-community.org
>> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
>> website : http://www.koha-community.org/
>> git : http://git.koha-community.org/
>> bugs : http://bugs.koha-community.org/
>>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-devel/attachments/20111209/dd30d9d3/attachment.htm>


More information about the Koha-devel mailing list