[Catalyst] Slow template processing on debian lenny
Terence Monteiro
terence at deeproot.co.in
Mon Sep 15 09:47:22 BST 2008
Hi,
I've been using TT for years and enjoy the features it provides. In one of
my Catalyst applications, I'm processing a template which generates HTML to
give me a table with counts taken from a hash. I'm using a lot of nested
FOREACH to generate the table.
On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to
process the template. On a production server using debian lenny, it used to
take around the same amount of time. But recently, I upgraded it to libperl
5.10 and updated the different Perl modules including Template and
Catalyst::View::TT. After this upgrade, the same template takes 25 seconds
on average to process. The times I am mentioning are the times taken on the
server side, as shown by the Catalyst application debug logs.
I tried to work around the problem by bypassing C::V::TT and using the
following code to process the template inside the controller, but to no ava=
il:
my $tmpl =3D Template->new({
INCLUDE_PATH =3D> $c->config->{home} . '/root',
RELATIVE =3D> 1
});
my $output =3D '';
$tmpl->process('index.tt', { %{$c->stash}, c =3D> $c }, \$output);
$c->res->body($output);
The sources.list reads:
deb ftp://ftp.tw.debian.org/debian lenny main
The output from perl Makefile.PL is:
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- Catalyst ...loaded. (5.7014 >=3D 5.70=
10)
- Catalyst::Controller ...loaded. (0)
- Catalyst::Action::RenderView ...loaded. (0.08 >=3D 0.04)
- Catalyst::Plugin::ConfigLoader ...loaded. (0.21 >=3D 0.14)
- Catalyst::Plugin::Static::Simple ...loaded. (0.20 >=3D 0.20)
- Catalyst::Plugin::Prototype ...loaded. (1.33 >=3D 1.33)
- Catalyst::Plugin::Session ...loaded. (0.19 >=3D 0.14)
- Catalyst::Plugin::Session::Store::FastMmap ...loaded. (0.05 >=3D 0.02)
- Catalyst::Plugin::Session::State::Cookie ...loaded. (0.09 >=3D 0.07)
- Catalyst::Plugin::Unicode ...loaded. (0.8 >=3D 0.2)
- Catalyst::View::PNGTTGraph ...loaded. (0.02 >=3D 0.02)
- Catalyst::View::TT ...loaded. (0.27 >=3D 0.25)
- Catalyst::View::Download ...loaded. (0.04 >=3D 0.04)
- Data::Page ...loaded. (2.00 >=3D 2.00)
- Date::Calc ...loaded. (5.4 >=3D 5.4)
- Date::Formatter ...loaded. (0.09 >=3D 0.09)
- Date::Manip ...loaded. (5.54 >=3D 0.04)
- DBI ...loaded. (1.607 >=3D 1.57)
- FindBin ...loaded. (1.49 >=3D 1.47)
- HTML::FormatText ...loaded. (2.04 >=3D 2.04)
- HTML::TreeBuilder ...loaded. (3.23 >=3D 3.23)
- MIME::Entity ...loaded. (5.420 >=3D 5.420)
- Module::Install ...loaded. (0.75 >=3D 0.68)
- Template ...loaded. (2.20 >=3D 2.19)
- Template::Plugin::Date ...loaded. (2.77 >=3D 2.77)
- Template::Plugin::HtmlToText ...loaded. (0.03 >=3D 0.02)
- Time::Local ...loaded. (1.18 >=3D 1.17)
- YAML ...loaded. (0.66)
*** Module::AutoInstall configuration finished.
Writing Makefile for tirt
So though my modules are sufficiently recent, template processing is
extremely slow. Please help if you have faced a similar problem or have an
idea. I've attached the TT template.
-- =
Thanks and Regards,
Terence Monteiro.
DeepRoot Linux,
Ph: +91 (80) 4112 4781 / 85.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20080915/cdec4=
77b/summary.htm
More information about the Catalyst
mailing list