Bugzilla – Attachment 76230 Details for
Bug 20975
Improve auto escaping performance
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
AutoEscaping - no filter
AutoEscaping---no-filter.patch (text/plain), 1.65 KB, created by
Jonathan Druart
on 2018-06-21 14:03:41 UTC
(
hide
)
Description:
AutoEscaping - no filter
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-06-21 14:03:41 UTC
Size:
1.65 KB
patch
obsolete
>From 04637c4866c506f5daa7cd8c60f9c2a3720b843d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >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 => '<script>my foo</script>', >+ bar => 'my bar', >+ }; >+} >+my $vars = { >+ pouet => 'my var', >+ loop => \@loop, >+}; >+ >+ >+$tt->process(\*DATA, $vars, \$output ) >+ || die $tt->error(), "\n"; >+#say $output; >+ >+__DATA__ >+[% pouet %] >+<div style="display:none;"> >+[% FOR l IN loop %] >+ [% l.foo %] [% l.bar %] >+ <br/> >+[% END %] >+</div> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20975
: 76230 |
76231
|
76232
|
76233
|
76234
|
76235