From 04637c4866c506f5daa7cd8c60f9c2a3720b843d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 20 Jun 2018 17:17:01 -0300 Subject: [PATCH] AutoEscaping - no filter for x in 1 2 3 4 5; do time perl benchmark_AutoEscaping.pl; done perl benchmark_AutoEscaping.pl 0.20s user 0.00s system 98% cpu 0.208 total perl benchmark_AutoEscaping.pl 0.19s user 0.02s system 98% cpu 0.214 total perl benchmark_AutoEscaping.pl 0.18s user 0.02s system 98% cpu 0.204 total perl benchmark_AutoEscaping.pl 0.18s user 0.02s system 98% cpu 0.202 total perl benchmark_AutoEscaping.pl 0.18s user 0.02s system 97% cpu 0.205 total https://bugs.koha-community.org/show_bug.cgi?id=20975 --- benchmark_AutoEscaping.pl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 benchmark_AutoEscaping.pl diff --git a/benchmark_AutoEscaping.pl b/benchmark_AutoEscaping.pl new file mode 100644 index 0000000000..63b258d9bd --- /dev/null +++ b/benchmark_AutoEscaping.pl @@ -0,0 +1,37 @@ +use Modern::Perl; +use Template; +use Template::Stash::AutoEscaping; +my $tt = Template->new( + { + ABSOLUTE => 1, + PLUGIN_BASE => 'Koha::Template::Plugin', + } +); + +my $output; + +my @loop; +for my $i ( 0 .. 10000 ) { + push @loop, { + foo => '', + bar => 'my bar', + }; +} +my $vars = { + pouet => 'my var', + loop => \@loop, +}; + + +$tt->process(\*DATA, $vars, \$output ) + || die $tt->error(), "\n"; +#say $output; + +__DATA__ +[% pouet %] +
+[% FOR l IN loop %] + [% l.foo %] [% l.bar %] +
+[% END %] +
-- 2.11.0