← Index
NYTProf Performance Profile   « line view »
For fastest.pl
  Run on Fri Jan 31 20:48:16 2014
Reported on Fri Jan 31 20:49:40 2014

Filename/opt/perl-5.18.1/lib/site_perl/5.18.1/Class/Load/PP.pm
StatementsExecuted 1204 statements in 4.70ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
108111.49ms4.94msClass::Load::PP::::_is_class_loadedClass::Load::PP::_is_class_loaded
10833566µs5.50msClass::Load::PP::::is_class_loadedClass::Load::PP::is_class_loaded
111429µs1.45msClass::Load::PP::::BEGIN@9Class::Load::PP::BEGIN@9
11119µs35µsClass::Load::PP::::BEGIN@6Class::Load::PP::BEGIN@6
1119µs46µsClass::Load::PP::::BEGIN@10Class::Load::PP::BEGIN@10
1119µs45µsClass::Load::PP::::BEGIN@11Class::Load::PP::BEGIN@11
1119µs14µsClass::Load::PP::::BEGIN@7Class::Load::PP::BEGIN@7
1118µs22µsClass::Load::PP::::BEGIN@8Class::Load::PP::BEGIN@8
0000s0sClass::Load::PP::::__ANON__[:25]Class::Load::PP::__ANON__[:25]
0000s0sClass::Load::PP::::__ANON__[:28]Class::Load::PP::__ANON__[:28]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::Load::PP;
2{
321µs $Class::Load::PP::VERSION = '0.20';
4}
5
6232µs252µ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
use strict;
# spent 35µs making 1 call to Class::Load::PP::BEGIN@6 # spent 16µs making 1 call to strict::import
7231µs219µ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
use warnings;
# spent 14µs making 1 call to Class::Load::PP::BEGIN@7 # spent 5µs making 1 call to warnings::import
8233µs236µ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
use Module::Runtime 'is_module_name';
# spent 22µs making 1 call to Class::Load::PP::BEGIN@8 # spent 14µs making 1 call to Module::Runtime::import
93168µs21.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
use Package::Stash 0.14;
# spent 1.45ms making 1 call to Class::Load::PP::BEGIN@9 # spent 11µs making 1 call to UNIVERSAL::VERSION
10232µs283µ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
use Scalar::Util 'blessed', 'reftype';
# spent 46µs making 1 call to Class::Load::PP::BEGIN@10 # spent 37µs making 1 call to Exporter::import
112292µs282µ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
use Try::Tiny;
# 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
sub is_class_loaded {
1410831µs my $class = shift;
1510812µs my $options = shift;
16
17108181µs1084.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
1910823µs return $loaded if ! $loaded;
20104224µ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
sub _is_class_loaded {
3210823µs my $class = shift;
33
34108143µs1081.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
36108856µs108538µs my $stash = Package::Stash->new($class);
# spent 538µs making 108 calls to Package::Stash::XS::new, avg 5µs/call
37
381081.28ms3241.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
3952334µs104228µ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
405211µs if (defined $version) {
4152188µ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
4956745µs216434µ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
54437µs826µ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
57419µs return 0;
58}
59
6014µs1;