You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Geoffrey Young <ge...@modperlcookbook.org> on 2007/05/11 16:13:37 UTC
RFC: Devel::Profiler::Plugins::Template
hi all :)
I spent some time this week adding hooks for template toolkit into
Devel::Profiler. you can find the code here
http://www.modperlcookbook.org/~geoff/modules/experimental/Devel-Profiler-Plugins-Template-0.01.tar.gz
I'm not entirely convinced of the namespace, which is why it's not on
CPAN yet. but I'd appreciate it if folks could give it a whirl when
they have the chance.
--Geoff
from the docs:
use Devel::Profiler::Plugins::Template; # enable TT hooks
use Devel::Profiler; # required
...
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 C<dprofpp> results will look like this
%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.
...
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.