← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:12:22 2013

Filename/usr/lib/perl5/Params/ValidateXS.pm
StatementsExecuted 17 statements in 780µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
4996530.6ms30.8msParams::Validate::::_validateParams::Validate::_validate (xsub)
4232112.4ms12.4msParams::Validate::::_validate_posParams::Validate::_validate_pos (xsub)
11122µs27µsParams::Validate::::BEGIN@3.4Params::Validate::BEGIN@3.4
11121µs21µsParams::Validate::::BEGIN@41Params::Validate::BEGIN@41
11116µs38µsParams::Validate::::BEGIN@4Params::Validate::BEGIN@4
0000s0sParams::Validate::::__ANON__[:11]Params::Validate::__ANON__[:11]
0000s0sParams::Validate::::_check_regex_from_xsParams::Validate::_check_regex_from_xs
0000s0sParams::Validate::::validation_optionsParams::Validate::validation_options
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Params::Validate;
2
3346µs231µs
# spent 27µs (22+4) within Params::Validate::BEGIN@3.4 which was called: # once (22µs+4µs) by Params::Validate::BEGIN@5 at line 3
use strict;
# spent 27µs making 1 call to Params::Validate::BEGIN@3.4 # spent 4µs making 1 call to strict::import
43379µs261µs
# spent 38µs (16+23) within Params::Validate::BEGIN@4 which was called: # once (16µs+23µs) by Params::Validate::BEGIN@5 at line 4
use warnings;
# spent 38µs making 1 call to Params::Validate::BEGIN@4 # spent 23µs making 1 call to warnings::import
5
61700nsrequire XSLoader;
71282µs1270µsXSLoader::load( 'Params::Validate', $Params::Validate::VERSION );
# spent 270µs making 1 call to XSLoader::load
8
9
10my $default_fail = sub { require Carp;
1116µs Carp::confess($_[0]) };
12
13{
1429µs my %defaults = ( ignore_case => 0,
15 strip_leading => 0,
16 allow_extra => 0,
17 on_fail => $default_fail,
18 stack_skip => 1,
19 normalize_keys => undef,
20 );
21
2213µs *set_options = \&validation_options;
23 sub validation_options
24 {
25 my %opts = @_;
26
27 my $caller = caller;
28
29 foreach ( keys %defaults )
30 {
31 $opts{$_} = $defaults{$_} unless exists $opts{$_};
32 }
33
34 $OPTIONS{$caller} = \%opts;
35 }
36}
37
38sub _check_regex_from_xs { return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0 }
39
40BEGIN
41
# spent 21µs within Params::Validate::BEGIN@41 which was called: # once (21µs+0s) by Params::Validate::BEGIN@5 at line 135
{
4219µs if ( $] >= 5.006 && $] < 5.007 )
43 {
44 eval <<'EOF';
45sub check_for_error
46{
47 if ( defined $Params::Validate::ERROR )
48 {
49 $Params::Validate::ON_FAIL ||= sub { require Carp; Carp::croak( $_[0] ) };
50
51 $Params::Validate::ON_FAIL->($Params::Validate::ERROR)
52 }
53}
54
55sub validate_pos (\@@)
56{
57 local $Params::Validate::ERROR;
58 local $Params::Validate::ON_FAIL;
59 local $Params::Validate::CALLER = caller;
60
61 my $r;
62 if (defined wantarray)
63 {
64 $r = &_validate_pos;
65 }
66 else
67 {
68 &_validate_pos;
69 }
70
71 check_for_error();
72
73 return wantarray ? @$r : $r if defined wantarray;
74}
75
76sub validate (\@$)
77{
78 local $Params::Validate::ERROR;
79 local $Params::Validate::ON_FAIL;
80 local $Params::Validate::CALLER = caller;
81
82 my $r;
83 if (defined wantarray)
84 {
85 $r = &_validate;
86 }
87 else
88 {
89 &_validate;
90 }
91
92 check_for_error();
93
94 return wantarray ? %$r : $r if defined wantarray;
95}
96
97sub validate_with
98{
99 local $Params::Validate::ERROR;
100 local $Params::Validate::ON_FAIL;
101 local $Params::Validate::CALLER = caller;
102
103 my $r;
104 if (defined wantarray)
105 {
106 $r = &_validate_with;
107 }
108 else
109 {
110 &_validate_with;
111 }
112
113 check_for_error();
114
115 my %p = @_;
116 if ( UNIVERSAL::isa( $p{spec}, 'ARRAY' ) )
117 {
118 return wantarray ? @$r : $r if defined wantarray;
119 }
120 else
121 {
122 return wantarray ? %$r : $r if defined wantarray;
123 }
124}
125EOF
126
127 die $@ if $@;
128 }
129 else
130 {
13116µs *validate = \&_validate;
13213µs *validate_pos = \&_validate_pos;
13314µs *validate_with = \&_validate_with;
134 }
135122µs121µs}
# spent 21µs making 1 call to Params::Validate::BEGIN@41
136
13719µs1;
138
139__END__
 
# spent 30.8ms (30.6+171µs) within Params::Validate::_validate which was called 499 times, avg 62µs/call: # 466 times (28.6ms+0s) by DateTime::Locale::_register at line 41 of DateTime/Locale.pm, avg 61µs/call # 10 times (725µs+93µs) by DateTime::Format::Builder::Parser::create_single_parser at line 311 of DateTime/Format/Builder/Parser.pm, avg 82µs/call # 10 times (679µs+78µs) by DateTime::Format::Builder::Parser::create_single_parser at line 333 of DateTime/Format/Builder/Parser.pm, avg 76µs/call # 10 times (434µs+0s) by DateTime::Format::Builder::Parser::generic::generic_parser at line 69 of DateTime/Format/Builder/Parser/generic.pm, avg 43µs/call # 2 times (99µs+0s) by DateTime::TimeZone::new at line 34 of DateTime/TimeZone.pm, avg 50µs/call # once (67µs+0s) by DateTime::Format::Builder::create_class at line 61 of DateTime/Format/Builder.pm
sub Params::Validate::_validate; # xsub
# spent 12.4ms within Params::Validate::_validate_pos which was called 423 times, avg 29µs/call: # 422 times (12.4ms+0s) by DateTime::Locale::_registered_id at line 92 of DateTime/Locale.pm, avg 29µs/call # once (60µs+0s) by DateTime::Locale::load at line 182 of DateTime/Locale.pm
sub Params::Validate::_validate_pos; # xsub