Filename | /usr/lib/x86_64-linux-gnu/perl5/5.20/Params/Validate/XS.pm |
Statements | Executed 15 statements in 437µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
499 | 6 | 5 | 5.52ms | 5.59ms | validate (xsub) | Params::Validate::XS::
424 | 2 | 1 | 1.14ms | 1.14ms | validate_pos (xsub) | Params::Validate::XS::
1 | 1 | 1 | 12µs | 25µs | BEGIN@3 | Params::Validate::XS::
1 | 1 | 1 | 7µs | 44µs | BEGIN@6 | Params::Validate::XS::
1 | 1 | 1 | 7µs | 12µs | BEGIN@4 | Params::Validate::XS::
1 | 1 | 1 | 6µs | 6µs | BEGIN@36 | Params::Validate::XS::
0 | 0 | 0 | 0s | 0s | __ANON__[:10] | 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 | 1 | 300ns | $Params::Validate::XS::VERSION = '1.13'; | ||
3 | 2 | 25µs | 2 | 37µs | # spent 25µs (12+12) within Params::Validate::XS::BEGIN@3 which was called:
# once (12µs+12µs) by Module::Runtime::require_module at line 3 # spent 25µs making 1 call to Params::Validate::XS::BEGIN@3
# spent 12µs making 1 call to strict::import |
4 | 2 | 22µs | 2 | 16µs | # spent 12µs (7+4) within Params::Validate::XS::BEGIN@4 which was called:
# once (7µs+4µs) by Module::Runtime::require_module at line 4 # spent 12µs making 1 call to Params::Validate::XS::BEGIN@4
# spent 4µs making 1 call to warnings::import |
5 | |||||
6 | 2 | 144µs | 2 | 80µs | # spent 44µs (7+36) within Params::Validate::XS::BEGIN@6 which was called:
# once (7µs+36µs) by Module::Runtime::require_module at line 6 # spent 44µs making 1 call to Params::Validate::XS::BEGIN@6
# spent 36µs making 1 call to Exporter::import |
7 | |||||
8 | my $default_fail = sub { | ||||
9 | Carp::confess( $_[0] ); | ||||
10 | 1 | 2µs | }; | ||
11 | |||||
12 | { | ||||
13 | 2 | 5µs | my %defaults = ( | ||
14 | 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 | |||||
22 | 1 | 800ns | *set_options = \&validation_options; | ||
23 | |||||
24 | sub validation_options { | ||||
25 | my %opts = @_; | ||||
26 | |||||
27 | my $caller = caller; | ||||
28 | |||||
29 | foreach ( keys %defaults ) { | ||||
30 | $opts{$_} = $defaults{$_} unless exists $opts{$_}; | ||||
31 | } | ||||
32 | |||||
33 | $Params::Validate::OPTIONS{$caller} = \%opts; | ||||
34 | } | ||||
35 | |||||
36 | 2 | 87µs | 1 | 6µs | # spent 6µs within Params::Validate::XS::BEGIN@36 which was called:
# once (6µs+0s) by Module::Runtime::require_module at line 36 # spent 6µs making 1 call to Params::Validate::XS::BEGIN@36 |
37 | XSLoader::load( | ||||
38 | __PACKAGE__, | ||||
39 | exists $Params::Validate::XS::{VERSION} | ||||
40 | 1 | 145µs | 1 | 138µs | ? ${ $Params::Validate::XS::{VERSION} } # spent 138µs making 1 call to XSLoader::load |
41 | : (), | ||||
42 | ); | ||||
43 | } | ||||
44 | |||||
45 | sub _check_regex_from_xs { | ||||
46 | return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0; | ||||
47 | } | ||||
48 | |||||
49 | 1 | 6µs | 1; | ||
# spent 5.59ms (5.52+71µs) within Params::Validate::XS::validate which was called 499 times, avg 11µs/call:
# 466 times (5.06ms+0s) by DateTime::Locale::_register at line 41 of DateTime/Locale.pm, avg 11µs/call
# 10 times (189µs+39µs) by DateTime::Format::Builder::Parser::create_single_parser at line 164 of DateTime/Format/Builder/Parser.pm, avg 23µs/call
# 10 times (162µs+32µs) by DateTime::Format::Builder::Parser::create_single_parser at line 185 of DateTime/Format/Builder/Parser.pm, avg 19µs/call
# 10 times (65µs+0s) by DateTime::Format::Builder::Parser::generic::generic_parser at line 26 of DateTime/Format/Builder/Parser/generic.pm, avg 7µs/call
# 2 times (18µs+0s) by DateTime::TimeZone::new at line 34 of DateTime/TimeZone.pm, avg 9µs/call
# once (18µs+0s) by DateTime::Format::Builder::create_class at line 31 of DateTime/Format/Builder.pm | |||||
# spent 1.14ms within Params::Validate::XS::validate_pos which was called 424 times, avg 3µs/call:
# 422 times (1.13ms+0s) by DateTime::Locale::_registered_id at line 92 of DateTime/Locale.pm, avg 3µs/call
# 2 times (10µs+0s) by DateTime::Locale::load at line 182 of DateTime/Locale.pm, avg 5µs/call |