Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Readonly/Hash.pm |
Statements | Executed 95745 statements in 102ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
17389 | 6 | 2 | 64.6ms | 84.1ms | EXISTS | Readonly::Hash::
14175 | 10 | 7 | 19.6ms | 19.6ms | FETCH | Readonly::Hash::
157 | 1 | 1 | 1.46ms | 1.63ms | TIEHASH | Readonly::Hash::
157 | 1 | 1 | 171µs | 171µs | CORE:match (opcode) | Readonly::Hash::
47 | 5 | 4 | 52µs | 52µs | NEXTKEY | Readonly::Hash::
5 | 5 | 4 | 15µs | 15µs | FIRSTKEY | Readonly::Hash::
0 | 0 | 0 | 0s | 0s | __ANON__[:38] | Readonly::Hash::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Readonly::Hash; | ||||
2 | 1 | 600ns | our $VERSION = '1.04'; | ||
3 | |||||
4 | # spent 1.63ms (1.46+171µs) within Readonly::Hash::TIEHASH which was called 157 times, avg 10µs/call:
# 157 times (1.46ms+171µs) by Readonly::Hash at line 168 of Readonly.pm, avg 10µs/call | ||||
5 | 157 | 302µs | my $whence | ||
6 | = (caller 1)[3]; # Check if naughty user is trying to tie directly. | ||||
7 | 157 | 442µs | 157 | 171µs | Readonly::croak "Invalid tie" unless $whence =~ /^Readonly::Hash1?$/; # spent 171µs making 157 calls to Readonly::Hash::CORE:match, avg 1µs/call |
8 | 157 | 35µs | my $class = shift; | ||
9 | |||||
10 | # must have an even number of values | ||||
11 | 157 | 37µs | Readonly::croak $Readonly::ODDHASH unless (@_ % 2 == 0); | ||
12 | 157 | 486µs | my %self = @_; | ||
13 | 157 | 378µs | return bless \%self, $class; | ||
14 | } | ||||
15 | |||||
16 | # spent 19.6ms within Readonly::Hash::FETCH which was called 14175 times, avg 1µs/call:
# 13481 times (18.5ms+0s) by Perl::Critic::Policy::InputOutput::RequireEncodingWithUTF8Layer::violates at line 46 of Perl/Critic/Policy/InputOutput/RequireEncodingWithUTF8Layer.pm, avg 1µs/call
# 362 times (644µs+0s) by Exporter::Heavy::heavy_export at line 87 of Exporter/Heavy.pm, avg 2µs/call
# 161 times (232µs+0s) by Perl::Critic::Utils::all_perl_files at line 1104 of Perl/Critic/Utils.pm, avg 1µs/call
# 97 times (149µs+0s) by Perl::Critic::PolicyParameter::_get_behavior_for_name at line 54 of Perl/Critic/PolicyParameter.pm, avg 2µs/call
# 55 times (94µs+0s) by Perl::Critic::Utils::precedence_of at line 701 of Perl/Critic/Utils.pm, avg 2µs/call
# 14 times (19µs+0s) by Perl::Critic::Utils::CORE:sort at line 1060 of Perl/Critic/Utils.pm, avg 1µs/call
# 2 times (3µs+0s) by Readonly::Hash at line 152 of Readonly.pm, avg 2µs/call
# once (2µs+0s) by Readonly::Scalar at line 104 of Readonly.pm
# once (2µs+0s) by Perl::Critic::UserProfile::_load_profile at line 162 of Perl/Critic/UserProfile.pm
# once (2µs+0s) by Perl::Critic::Config::_validate_and_save_profile_strictness at line 446 of Perl/Critic/Config.pm | ||||
17 | 14175 | 2.40ms | my $self = shift; | ||
18 | 14175 | 1.57ms | my $key = shift; | ||
19 | 14175 | 37.7ms | return $self->{$key}; | ||
20 | } | ||||
21 | |||||
22 | # spent 84.1ms (64.6+19.6) within Readonly::Hash::EXISTS which was called 17389 times, avg 5µs/call:
# 9353 times (38.2ms+11.0ms) by Perl::Critic::Utils::McCabe::_count_logic_keywords at line 113 of Perl/Critic/Utils/McCabe.pm, avg 5µs/call
# 7354 times (25.2ms+8.62ms) by Perl::Critic::Utils::McCabe::_count_logic_operators at line 130 of Perl/Critic/Utils/McCabe.pm, avg 5µs/call
# 527 times (773µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 655 of Perl/Critic/Utils.pm, avg 1µs/call
# 77 times (200µs+0s) by Perl::Critic::Utils::is_perl_bareword at line 379 of Perl/Critic/Utils.pm, avg 3µs/call
# 77 times (119µs+0s) by Perl::Critic::Utils::is_perl_filehandle at line 422 of Perl/Critic/Utils.pm, avg 2µs/call
# once (3µs+0s) by Perl::Critic::Utils::is_valid_numeric_verbosity at line 1038 of Perl/Critic/Utils.pm | ||||
23 | 17389 | 3.44ms | my $self = shift; | ||
24 | 17389 | 640µs | my $key = shift; | ||
25 | 17389 | 54.6ms | 16707 | 19.6ms | return exists $self->{$key}; # spent 19.6ms making 16707 calls to PPI::Token::content, avg 1µs/call |
26 | } | ||||
27 | |||||
28 | # spent 15µs within Readonly::Hash::FIRSTKEY which was called 5 times, avg 3µs/call:
# once (4µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 477 of Perl/Critic/Utils.pm
# once (4µs+0s) by Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls::supported_parameters at line 37 of Perl/Critic/Policy/ControlStructures/ProhibitPostfixControls.pm
# once (3µs+0s) by Module::Pluggable::Object::_require at line 34 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm
# once (2µs+0s) by Perl::Critic::Policy::Documentation::RequirePodSections::supported_parameters at line 205 of Perl/Critic/Policy/Documentation/RequirePodSections.pm
# once (2µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 1060 of Perl/Critic/Utils.pm | ||||
29 | 5 | 2µs | my $self = shift; | ||
30 | 5 | 4µs | my $dummy = keys %$self; | ||
31 | 5 | 18µs | return scalar each %$self; | ||
32 | } | ||||
33 | |||||
34 | # spent 52µs within Readonly::Hash::NEXTKEY which was called 47 times, avg 1µs/call:
# 29 times (30µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 477 of Perl/Critic/Utils.pm, avg 1µs/call
# 7 times (9µs+0s) by Perl::Critic::Policy::ControlStructures::ProhibitPostfixControls::supported_parameters at line 37 of Perl/Critic/Policy/ControlStructures/ProhibitPostfixControls.pm, avg 1µs/call
# 5 times (6µs+0s) by Perl::Critic::Exception::Parse::BEGIN@18 at line 1060 of Perl/Critic/Utils.pm, avg 1µs/call
# 4 times (4µs+0s) by Perl::Critic::Policy::Documentation::RequirePodSections::supported_parameters at line 205 of Perl/Critic/Policy/Documentation/RequirePodSections.pm, avg 1µs/call
# 2 times (3µs+0s) by Module::Pluggable::Object::_require at line 34 of Perl/Critic/Policy/RegularExpressions/ProhibitUnusedCapture.pm, avg 1µs/call | ||||
35 | 47 | 6µs | my $self = shift; | ||
36 | 47 | 82µs | return scalar each %$self; | ||
37 | } | ||||
38 | 1 | 6µs | *STORE = *DELETE = *CLEAR = *UNTIE = sub { Readonly::croak $Readonly::MODIFY}; | ||
# spent 171µs within Readonly::Hash::CORE:match which was called 157 times, avg 1µs/call:
# 157 times (171µs+0s) by Readonly::Hash::TIEHASH at line 7, avg 1µs/call |