Skip to content

Instantly share code, notes, and snippets.

@kazuph
Created March 23, 2013 12:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazuph/5227636 to your computer and use it in GitHub Desktop.
Save kazuph/5227636 to your computer and use it in GitHub Desktop.
Devel::KYTProfでうまくいくバージョン
#!/usr/bin/env perl
use strict;
use warnings;
use Text::Xslate;
use Devel::KYTProf;
use Data::Section::Simple;
Devel::KYTProf->add_prof(
"Text::Xslate",
"render",
sub {
my ($orig, $self, $file, $args) = @_;
return [sprintf '%s %s', "render", $file];
}
);
my $tx = Text::Xslate->new(
path => [ Data::Section::Simple ->new()->get_data_section(), ],
);
print $tx->render('test.tx');
__DATA__
@@ test.tx
test
@@ result
3.092 ms [Text::Xslate] render test.tx | main:21
test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment