| Filename | /usr/lib/perl5/Params/Validate/XS.pm |
| Statements | Executed 14 statements in 2.13ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 5 | 1 | 1 | 54µs | 54µs | Params::Validate::XS::validate (xsub) |
| 5 | 1 | 1 | 38µs | 38µs | Params::Validate::XS::validate_with (xsub) |
| 1 | 1 | 1 | 9µs | 20µs | Params::Validate::XS::BEGIN@6 |
| 1 | 1 | 1 | 6µs | 11µs | Params::Validate::XS::BEGIN@7 |
| 1 | 1 | 1 | 6µs | 6µs | Params::Validate::XS::BEGIN@38 |
| 0 | 0 | 0 | 0s | 0s | Params::Validate::XS::__ANON__[:12] |
| 0 | 0 | 0 | 0s | 0s | Params::Validate::XS::_check_regex_from_xs |
| 0 | 0 | 0 | 0s | 0s | Params::Validate::XS::validation_options |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Params::Validate::XS; | ||||
| 2 | { | ||||
| 3 | 2 | 600ns | $Params::Validate::XS::VERSION = '1.08'; | ||
| 4 | } | ||||
| 5 | |||||
| 6 | 2 | 20µs | 2 | 30µs | # spent 20µs (9+10) within Params::Validate::XS::BEGIN@6 which was called:
# once (9µs+10µs) by Module::Runtime::require_module at line 6 # spent 20µs making 1 call to Params::Validate::XS::BEGIN@6
# spent 10µs making 1 call to strict::import |
| 7 | 2 | 119µs | 2 | 15µs | # spent 11µs (6+4) within Params::Validate::XS::BEGIN@7 which was called:
# once (6µs+4µs) by Module::Runtime::require_module at line 7 # spent 11µs making 1 call to Params::Validate::XS::BEGIN@7
# spent 4µs making 1 call to warnings::import |
| 8 | |||||
| 9 | my $default_fail = sub { | ||||
| 10 | require Carp; | ||||
| 11 | Carp::confess( $_[0] ); | ||||
| 12 | 1 | 2µs | }; | ||
| 13 | |||||
| 14 | { | ||||
| 15 | 2 | 4µs | my %defaults = ( | ||
| 16 | ignore_case => 0, | ||||
| 17 | strip_leading => 0, | ||||
| 18 | allow_extra => 0, | ||||
| 19 | on_fail => $default_fail, | ||||
| 20 | stack_skip => 1, | ||||
| 21 | normalize_keys => undef, | ||||
| 22 | ); | ||||
| 23 | |||||
| 24 | 1 | 700ns | *set_options = \&validation_options; | ||
| 25 | |||||
| 26 | sub validation_options { | ||||
| 27 | my %opts = @_; | ||||
| 28 | |||||
| 29 | my $caller = caller; | ||||
| 30 | |||||
| 31 | foreach ( keys %defaults ) { | ||||
| 32 | $opts{$_} = $defaults{$_} unless exists $opts{$_}; | ||||
| 33 | } | ||||
| 34 | |||||
| 35 | $Params::Validate::OPTIONS{$caller} = \%opts; | ||||
| 36 | } | ||||
| 37 | |||||
| 38 | 2 | 72µs | 1 | 6µs | # spent 6µs within Params::Validate::XS::BEGIN@38 which was called:
# once (6µs+0s) by Module::Runtime::require_module at line 38 # spent 6µs making 1 call to Params::Validate::XS::BEGIN@38 |
| 39 | XSLoader::load( | ||||
| 40 | __PACKAGE__, | ||||
| 41 | exists $Params::Validate::XS::{VERSION} | ||||
| 42 | 1 | 1.90ms | 1 | 1.90ms | ? ${ $Params::Validate::XS::{VERSION} } # spent 1.90ms making 1 call to XSLoader::load |
| 43 | : (), | ||||
| 44 | ); | ||||
| 45 | } | ||||
| 46 | |||||
| 47 | sub _check_regex_from_xs { | ||||
| 48 | return ( defined $_[0] ? $_[0] : '' ) =~ /$_[1]/ ? 1 : 0; | ||||
| 49 | } | ||||
| 50 | |||||
| 51 | 1 | 7µs | 1; | ||
# spent 54µs within Params::Validate::XS::validate which was called 5 times, avg 11µs/call:
# 5 times (54µs+0s) by Getopt::Long::Descriptive::_validate_with at line 482 of Getopt/Long/Descriptive.pm, avg 11µs/call | |||||
# spent 38µs within Params::Validate::XS::validate_with which was called 5 times, avg 8µs/call:
# 5 times (38µs+0s) by Getopt::Long::Descriptive::_validate_with at line 534 of Getopt/Long/Descriptive.pm, avg 8µs/call |