Created
July 30, 2010 04:00
-
-
Save gfx/499871 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/Template/Benchmark/Engines/TextMicroTemplate.pm b/lib/Template/Benchmark/Engines/TextMicroTemplate.pm | |
| index 756421c..a4b1051 100644 | |
| --- a/lib/Template/Benchmark/Engines/TextMicroTemplate.pm | |
| +++ b/lib/Template/Benchmark/Engines/TextMicroTemplate.pm | |
| @@ -150,7 +150,7 @@ sub benchmark_functions_for_memory_cache | |
| my $t = Text::MicroTemplate::File->new( | |
| include_path => [ $template_dir ], | |
| escape_func => undef, | |
| - use_cache => 1, | |
| + use_cache => 2, | |
| ); | |
| $t->render_file( $_[ 0 ], { %{$_[ 1 ]}, %{$_[ 2 ]} } ); | |
| }, | |
| @@ -161,7 +161,19 @@ sub benchmark_functions_for_instance_reuse | |
| { | |
| my ( $self, $template_dir, $cache_dir ) = @_; | |
| - return( undef ); | |
| + my $t; | |
| + return( { | |
| + TeMT => | |
| + sub | |
| + { | |
| + $t ||= Text::MicroTemplate::File->new( | |
| + include_path => [ $template_dir ], | |
| + escape_func => undef, | |
| + use_cache => 2, | |
| + ); | |
| + $t->render_file( $_[ 0 ], { %{$_[ 1 ]}, %{$_[ 2 ]} } ); | |
| + }, | |
| + } ); | |
| } | |
| 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment