Filename | /usr/lib/perl5/site_perl/5.12.4/i686-linux/Params/Validate/XS.pm |
Statements | Executed 15 statements in 2.20ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
468 | 2 | 2 | 98.0ms | 98.0ms | validate (xsub) | Params::Validate::XS::
423 | 2 | 1 | 49.0ms | 49.0ms | validate_pos (xsub) | Params::Validate::XS::
1 | 1 | 1 | 83µs | 109µs | BEGIN@3 | Params::Validate::XS::
1 | 1 | 1 | 66µs | 161µs | BEGIN@4 | Params::Validate::XS::
1 | 1 | 1 | 65µs | 65µs | BEGIN@35 | Params::Validate::XS::
0 | 0 | 0 | 0s | 0s | __ANON__[:9] | Params::Validate::XS::
0 | 0 | 0 | 0s | 0s | _check_regex_from_xs | Params::Validate::XS::
0 | 0 | 0 | 0s | 0s | validation_options | Params::Validate::XS::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Params::Validate::XS; | ||||
2 | |||||
3 | 3 | 162µs | 2 | 135µs | # spent 109µs (83+26) within Params::Validate::XS::BEGIN@3 which was called:
# once (83µs+26µs) by Module::Runtime::require_module at line 3 # spent 109µs making 1 call to Params::Validate::XS::BEGIN@3
# spent 26µs making 1 call to strict::import |
4 | 3 | 760µs | 2 | 256µs | # spent 161µs (66+95) within Params::Validate::XS::BEGIN@4 which was called:
# once (66µs+95µs) by Module::Runtime::require_module at line 4 # spent 161µs making 1 call to Params::Validate::XS::BEGIN@4
# spent 95µs making 1 call to warnings::import |
5 | |||||
6 | my $default_fail = sub { | ||||
7 | require Carp; | ||||
8 | Carp::confess( $_[0] ); | ||||
9 | 1 | 16µs | }; | ||
10 | |||||
11 | { | ||||
12 | 2 | 25µs | my %defaults = ( | ||
13 | ignore_case => 0, | ||||
14 | strip_leading => 0, | ||||
15 | allow_extra => 0, | ||||
16 | on_fail => $default_fail, | ||||
17 | stack_skip => 1, | ||||
18 | normalize_keys => undef, | ||||
19 | ); | ||||
20 | |||||
21 | 1 | 8µs | *set_options = \&validation_options; | ||
22 | |||||
23 | sub validation_options { | ||||
24 | my %opts = @_; | ||||
25 | |||||
26 | my $caller = caller; | ||||
27 | |||||
28 | foreach ( keys %defaults ) { | ||||
29 | $opts{$_} = $defaults{$_} unless exists $opts{$_}; | ||||
30 | } | ||||
31 | |||||
32 | $Params::Validate::OPTIONS{$caller} = \%opts; | ||||
33 | } | ||||
34 | |||||
35 | 3 | 451µs | 1 | 65µs | # spent 65µs within Params::Validate::XS::BEGIN@35 which was called:
# once (65µs+0s) by Module::Runtime::require_module at line 35 # spent 65µs making 1 call to Params::Validate::XS::BEGIN@35 |
36 | XSLoader::load( | ||||
37 | __PACKAGE__, | ||||
38 | exists $Params::Validate::XS::{VERSION} | ||||
39 | 1 | 742µs | 1 | 704µs | ? ${ $Params::Validate::XS::{VERSION} } # spent 704µs making 1 call to XSLoader::load |
40 | : (), | ||||
41 | ); | ||||
42 | } | ||||
43 | |||||
44 | sub _check_regex_from_xs { | ||||
45 | return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0; | ||||
46 | } | ||||
47 | |||||
48 | 1 | 36µs | 1; | ||
# spent 98.0ms within Params::Validate::XS::validate which was called 468 times, avg 209µs/call:
# 466 times (97.7ms+0s) by DateTime::Locale::_register at line 41 of DateTime/Locale.pm, avg 210µs/call
# 2 times (312µs+0s) by DateTime::TimeZone::new at line 34 of DateTime/TimeZone.pm, avg 156µs/call | |||||
# spent 49.0ms within Params::Validate::XS::validate_pos which was called 423 times, avg 116µs/call:
# 422 times (48.9ms+0s) by DateTime::Locale::_registered_id at line 92 of DateTime/Locale.pm, avg 116µs/call
# once (136µs+0s) by DateTime::Locale::load at line 182 of DateTime/Locale.pm |