[Catalyst] Catalyst Performance issues

Nilson Santos Figueiredo Junior acid06 at gmail.com
Sat Oct 7 19:24:16 CEST 2006


On 10/7/06, Perrin Harkins <perrin at elem.com> wrote:
> Maybe this will help: http://www.modperlbook.org/html/ch09_05.html

Thanks, I'll try using Apache::DProf as suggested.

> How did you determine this?

Manually running and timing the queries as output when DBIC_TRACE=1.

Switching from running a "$rs->next" loop inside TT to loading the
objects inside the controller (through $rs->all). Then I tried using
$rs->all inside the template and noticed the time spent in the
controller going down and the spent in the end action going up by
approximately the same amount as I've timed when manually running the
queries.

> There are some generic things you can do to speed up TT (use PROCESS
> instead of INCLUDE, use the support for constants if you have any, make
> sure you are using the template cache), but I'd do a profile sorted by
> real time before spending the effort on them.

The template cache gives me a performance boost varying from almost 0%
to 10% (average 3%). Using PROCESS instead of INCLUDE makes a tiny
difference in my case. I'll take a look into using constants, I never
knew TT had them.

> Does your template do anything that might cause DBIC to fetch more data?

Some of them, yes.
The ones in question, no - they prefetch everything they need (at
least according to DBIC_TRACE there's nothing missing and only one
query is issued).

-Nilson Santos F. Jr.



More information about the Catalyst mailing list