Devel::Profiler::Plugins::Template - gather tmon.out data for Template Toolkit templates
use Devel::Profiler::Plugins::Template; # enable TT hooks use Devel::Profiler; # required my $tt = Template->new(); ...
Devel::Profiler::Plugins::Template wraps various Template Toolkit calls in such a way that they are captured by Devel::Profiler and added to tmon.out, thus making them visible through dprofpp. much hackery is involved, so it's not guaranteed to work on all platforms, versions of perl, or versions of TT. but if it does work, your dprofpp results will look like this
Devel::Profiler::Plugins::Template
tmon.out
dprofpp
%Time ExclSec CumulS #Calls sec/call Csec/c Name 3.20 0.048 0.048 1794 0.0000 0.0000 Encode::_utf8_on 1.27 0.019 0.028 2 0.0095 0.0140 TT::PROCESS::get_standard_nav 0.00 0.000 0.000 2 0.0000 0.0000 TT::INCLUDE::layout_2fframe_2fhead_2ett
which corresponds to something like
[% BLOCK get_standard_nav %] ... [% END %] [% PROCESS get_standard_nav %] [% INCLUDE layout/frame/head.tt %]
note that the TT results are right alongside of your normal perl calls, which I find very convenient.
currently, only PROCESS and INCLUDE blocks are instrumented. hopefully this list will grow over time.
PROCESS
INCLUDE
this module contains a number of hacks just to get things working at all, so it may not work for you. but it is working well at work, and if you ever saw our code you'd say that's probably a good enough test.
oh, and this probably won't work so well unless you have the current Devel::Profiler code from svn:
http://sourceforge.net/projects/devel-profiler/
but it might.
Devel::Profiler, Devel::Profiler::Plugins::Template::Context
Devel::Profiler
Devel::Profiler::Plugins::Template::Context
Geoffrey Young <geoff@modperlcookbook.org>
Copyright (c) 2007, Geoffrey Young All rights reserved.
This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
To install Devel::Profiler::Plugins::Template, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Profiler::Plugins::Template
CPAN shell
perl -MCPAN -e shell install Devel::Profiler::Plugins::Template
For more information on module installation, please visit the detailed CPAN module installation guide.