lib/Template/Benchmark/Engines/NTSTemplate.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« lib/Template/Benchmark/Engines/HTMLTemplatePro.pm ↑ Summary lib/Template/Benchmark/Engines/ParseTemplate.pm »
1 package Template::Benchmark::Engines::NTSTemplate;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use base qw/Template::Benchmark::Engine/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶use NTS::Template;
Subroutine BEGIN: called CC=1 SCAR=2.6
9  
10 our $VERSION = '1.09_01';
11  
12 our %feature_syntaxes = (
13 literal_text =>
14 join( "\n", ( join( ' ', ( 'foo' ) x 12 ) ) x 5 ),
15 scalar_variable =>
16 '[% scalar_variable %]',
17 hash_variable_value =>
18 '[% hash_variable.hash_value_key %]',
19 array_variable_value =>
20 undef,
21 deep_data_structure_value =>
22 '[% this.is.a.very.deep.hash.structure %]',
23 array_loop_value =>
24 '[% FOREACH i = array_loop %][% i %][% END %]',
25 hash_loop_value =>
26 undef,
27 records_loop_value =>
28 '[% FOREACH r = records_loop %][% r.name %]: ' .
29 '[% r.age %][% END %]',
30 array_loop_template =>
31 '[% FOREACH i = array_loop %][% i %][% END %]',
32 hash_loop_template =>
33 undef,
34 records_loop_template =>
35 '[% FOREACH r = records_loop %][% r.name %]: ' .
36 '[% r.age %][% END %]',
37 constant_if_literal =>
38 '[% IF 1 %]true[% END %]',
39 variable_if_literal =>
40 '[% IF variable_if %]true[% END %]',
41 constant_if_else_literal =>
42 '[% IF 1 %]true[% ELSE %]false[% END %]',
43 variable_if_else_literal =>
44 '[% IF variable_if_else %]true[% ELSE %]false[% END %]',
45 constant_if_template =>
46 '[% IF 1 %][% template_if_true %][% END %]',
47 variable_if_template =>
48 '[% IF variable_if %][% template_if_true %][% END %]',
49 constant_if_else_template =>
50 '[% IF 1 %][% template_if_true %][% ELSE %]' .
51 '[% template_if_false %][% END %]',
52 variable_if_else_template =>
53 '[% IF variable_if_else %][% template_if_true %][% ELSE %]' .
54 '[% template_if_false %][% END %]',
55 constant_expression =>
56 undef,
57 variable_expression =>
58 undef,
59 complex_variable_expression =>
60 undef,
61 constant_function =>
62 undef,
63 variable_function =>
64 undef,
65 );
66  
67 sub syntax_type { return( 'mini-language' ); }
68 sub pure_perl { return( 1 ); }
69  
70 sub benchmark_descriptions
71 {
72 return( {
73 NT =>
74 "NTS::Template ($NTS::Template::VERSION)",
75 } );
76 }
77  
78 sub benchmark_functions_for_uncached_string
79 {
80 my ( $self ) = @_;
81  
82 return( undef );
83 }
84  
85 sub benchmark_functions_for_uncached_disk
86 {
87 my ( $self, $template_dir ) = @_;
88  
89 return( {
90 NT =>
91 sub
92 {
93 my $t = NTS::Template->new();
94 \$t->process( {
95 templ_dir => $template_dir,
96 templ_file => $_[ 0 ],
97 templ_vars => { %{$_[ 1 ]} , %{$_[ 2 ]} },
98 templ_extra => {
99 # source => 1,
100 oreturn => 1,
101 },
102 } );
103 },
104 } );
105 }
106  
107 sub benchmark_functions_for_disk_cache
108 {
109 my ( $self, $template_dir, $cache_dir ) = @_;
110  
111 return( undef );
112 }
113  
114 sub benchmark_functions_for_shared_memory_cache
115 {
116 my ( $self, $template_dir, $cache_dir ) = @_;
117  
118 return( undef );
119 }
120  
121 sub benchmark_functions_for_memory_cache
122 {
123 my ( $self, $template_dir, $cache_dir ) = @_;
124  
125 return( undef );
126 }
127  
128 sub benchmark_functions_for_instance_reuse
129 {
130 my ( $self, $template_dir, $cache_dir ) = @_;
131  
132 return( undef );
133 }
134  
135 1;
136  
137 __END__
« lib/Template/Benchmark/Engines/HTMLTemplatePro.pm ↑ Summary lib/Template/Benchmark/Engines/ParseTemplate.pm »