Filename | /opt/perl-5.18.1/lib/site_perl/5.18.1/Class/Load/PP.pm |
Statements | Executed 1204 statements in 4.70ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
108 | 1 | 1 | 1.49ms | 4.94ms | _is_class_loaded | Class::Load::PP::
108 | 3 | 3 | 566µs | 5.50ms | is_class_loaded | Class::Load::PP::
1 | 1 | 1 | 429µs | 1.45ms | BEGIN@9 | Class::Load::PP::
1 | 1 | 1 | 19µs | 35µs | BEGIN@6 | Class::Load::PP::
1 | 1 | 1 | 9µs | 46µs | BEGIN@10 | Class::Load::PP::
1 | 1 | 1 | 9µs | 45µs | BEGIN@11 | Class::Load::PP::
1 | 1 | 1 | 9µs | 14µs | BEGIN@7 | Class::Load::PP::
1 | 1 | 1 | 8µs | 22µs | BEGIN@8 | Class::Load::PP::
0 | 0 | 0 | 0s | 0s | __ANON__[:25] | Class::Load::PP::
0 | 0 | 0 | 0s | 0s | __ANON__[:28] | Class::Load::PP::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Class::Load::PP; | ||||
2 | { | ||||
3 | 2 | 1µs | $Class::Load::PP::VERSION = '0.20'; | ||
4 | } | ||||
5 | |||||
6 | 2 | 32µs | 2 | 52µs | # spent 35µs (19+16) within Class::Load::PP::BEGIN@6 which was called:
# once (19µs+16µs) by Module::Runtime::require_module at line 6 # spent 35µs making 1 call to Class::Load::PP::BEGIN@6
# spent 16µs making 1 call to strict::import |
7 | 2 | 31µs | 2 | 19µs | # spent 14µs (9+5) within Class::Load::PP::BEGIN@7 which was called:
# once (9µs+5µs) by Module::Runtime::require_module at line 7 # spent 14µs making 1 call to Class::Load::PP::BEGIN@7
# spent 5µs making 1 call to warnings::import |
8 | 2 | 33µs | 2 | 36µs | # spent 22µs (8+14) within Class::Load::PP::BEGIN@8 which was called:
# once (8µs+14µs) by Module::Runtime::require_module at line 8 # spent 22µs making 1 call to Class::Load::PP::BEGIN@8
# spent 14µs making 1 call to Module::Runtime::import |
9 | 3 | 168µs | 2 | 1.46ms | # spent 1.45ms (429µs+1.02) within Class::Load::PP::BEGIN@9 which was called:
# once (429µs+1.02ms) by Module::Runtime::require_module at line 9 # spent 1.45ms making 1 call to Class::Load::PP::BEGIN@9
# spent 11µs making 1 call to UNIVERSAL::VERSION |
10 | 2 | 32µs | 2 | 83µs | # spent 46µs (9+37) within Class::Load::PP::BEGIN@10 which was called:
# once (9µs+37µs) by Module::Runtime::require_module at line 10 # spent 46µs making 1 call to Class::Load::PP::BEGIN@10
# spent 37µs making 1 call to Exporter::import |
11 | 2 | 292µs | 2 | 82µs | # spent 45µs (9+36) within Class::Load::PP::BEGIN@11 which was called:
# once (9µs+36µs) by Module::Runtime::require_module at line 11 # spent 45µs making 1 call to Class::Load::PP::BEGIN@11
# spent 36µs making 1 call to Exporter::import |
12 | |||||
13 | # spent 5.50ms (566µs+4.94) within Class::Load::PP::is_class_loaded which was called 108 times, avg 51µs/call:
# 54 times (278µs+2.72ms) by Class::MOP::Class::_immutable_metaclass at line 1345 of Class/MOP/Class.pm, avg 56µs/call
# 53 times (282µs+2.17ms) by Class::Load::try_load_class at line 144 of Class/Load.pm, avg 46µs/call
# once (5µs+45µs) by Moose::init_meta at line 158 of Moose.pm | ||||
14 | 108 | 31µs | my $class = shift; | ||
15 | 108 | 12µs | my $options = shift; | ||
16 | |||||
17 | 108 | 181µs | 108 | 4.94ms | my $loaded = _is_class_loaded($class); # spent 4.94ms making 108 calls to Class::Load::PP::_is_class_loaded, avg 46µs/call |
18 | |||||
19 | 108 | 23µs | return $loaded if ! $loaded; | ||
20 | 104 | 224µs | return $loaded unless $options && $options->{-version}; | ||
21 | |||||
22 | return try { | ||||
23 | $class->VERSION($options->{-version}); | ||||
24 | 1; | ||||
25 | } | ||||
26 | catch { | ||||
27 | 0; | ||||
28 | }; | ||||
29 | } | ||||
30 | |||||
31 | # spent 4.94ms (1.49+3.44) within Class::Load::PP::_is_class_loaded which was called 108 times, avg 46µs/call:
# 108 times (1.49ms+3.44ms) by Class::Load::PP::is_class_loaded at line 17, avg 46µs/call | ||||
32 | 108 | 23µs | my $class = shift; | ||
33 | |||||
34 | 108 | 143µs | 108 | 1.25ms | return 0 unless is_module_name($class); # spent 1.25ms making 108 calls to Module::Runtime::is_module_name, avg 12µs/call |
35 | |||||
36 | 108 | 856µs | 108 | 538µs | my $stash = Package::Stash->new($class); # spent 538µs making 108 calls to Package::Stash::XS::new, avg 5µs/call |
37 | |||||
38 | 108 | 1.28ms | 324 | 1.72ms | if ($stash->has_symbol('$VERSION')) { # spent 1.04ms making 108 calls to Package::Stash::XS::has_symbol, avg 10µs/call
# spent 613µs making 108 calls to Package::Stash::XS::namespace, avg 6µs/call
# spent 67µs making 108 calls to Package::Stash::XS::name, avg 624ns/call |
39 | 52 | 334µs | 104 | 228µs | my $version = ${ $stash->get_symbol('$VERSION') }; # spent 202µs making 52 calls to Package::Stash::XS::get_symbol, avg 4µs/call
# spent 26µs making 52 calls to Package::Stash::XS::namespace, avg 500ns/call |
40 | 52 | 11µs | if (defined $version) { | ||
41 | 52 | 188µs | return 1 if ! ref $version; | ||
42 | # Sometimes $VERSION ends up as a reference to undef (weird) | ||||
43 | return 1 if ref $version && reftype $version eq 'SCALAR' && defined ${$version}; | ||||
44 | # a version object | ||||
45 | return 1 if blessed $version; | ||||
46 | } | ||||
47 | } | ||||
48 | |||||
49 | 56 | 745µs | 216 | 434µs | if ($stash->has_symbol('@ISA')) { # spent 209µs making 56 calls to Package::Stash::XS::has_symbol, avg 4µs/call
# spent 177µs making 52 calls to Package::Stash::XS::get_symbol, avg 3µs/call
# spent 48µs making 108 calls to Package::Stash::XS::namespace, avg 445ns/call |
50 | return 1 if @{ $stash->get_symbol('@ISA') }; | ||||
51 | } | ||||
52 | |||||
53 | # check for any method | ||||
54 | 4 | 37µs | 8 | 26µs | return 1 if $stash->list_all_symbols('CODE'); # spent 24µs making 4 calls to Package::Stash::XS::list_all_symbols, avg 6µs/call
# spent 2µs making 4 calls to Package::Stash::XS::namespace, avg 425ns/call |
55 | |||||
56 | # fail | ||||
57 | 4 | 19µs | return 0; | ||
58 | } | ||||
59 | |||||
60 | 1 | 4µs | 1; |