| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Moo/Object.pm |
| Statements | Executed 4164 statements in 8.54ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1022 | 3 | 3 | 6.61ms | 6.61ms | Moo::Object::BUILDARGS |
| 20 | 3 | 3 | 142µs | 205µs | Moo::Object::new |
| 1 | 1 | 1 | 19µs | 20µs | Moo::Object::does |
| 1 | 1 | 1 | 10µs | 17µs | Moo::Object::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 14µs | Moo::Object::BEGIN@69 |
| 0 | 0 | 0 | 0s | 0s | Moo::Object::BUILDALL |
| 0 | 0 | 0 | 0s | 0s | Moo::Object::DEMOLISHALL |
| 0 | 0 | 0 | 0s | 0s | Moo::Object::meta |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moo::Object; | ||||
| 2 | |||||
| 3 | 2 | 272µs | 2 | 24µs | # spent 17µs (10+7) within Moo::Object::BEGIN@3 which was called:
# once (10µs+7µs) by Moo::import at line 3 # spent 17µs making 1 call to Moo::Object::BEGIN@3
# spent 8µs making 1 call to Moo::_strictures::import |
| 4 | |||||
| 5 | our %NO_BUILD; | ||||
| 6 | our %NO_DEMOLISH; | ||||
| 7 | our $BUILD_MAKER; | ||||
| 8 | our $DEMOLISH_MAKER; | ||||
| 9 | |||||
| 10 | # spent 205µs (142+63) within Moo::Object::new which was called 20 times, avg 10µs/call:
# 11 times (58µs+31µs) by Moo::_accessor_maker_for at line 147 of Moo.pm, avg 8µs/call
# 7 times (67µs+25µs) by Moo::Role::has at line 57 of Moo/Role.pm, avg 13µs/call
# 2 times (16µs+7µs) by Method::Generate::Constructor::buildall_generator at line 63 of Method/Generate/Constructor.pm, avg 12µs/call | ||||
| 11 | 20 | 6µs | my $class = shift; | ||
| 12 | 20 | 15µs | unless (exists $NO_DEMOLISH{$class}) { | ||
| 13 | 2 | 16µs | 2 | 5µs | unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) { # spent 5µs making 2 calls to UNIVERSAL::can, avg 2µs/call |
| 14 | ($DEMOLISH_MAKER ||= do { | ||||
| 15 | require Method::Generate::DemolishAll; | ||||
| 16 | Method::Generate::DemolishAll->new | ||||
| 17 | })->generate_method($class); | ||||
| 18 | } | ||||
| 19 | } | ||||
| 20 | 20 | 38µs | 20 | 52µs | my $proto = $class->BUILDARGS(@_); # spent 52µs making 20 calls to Moo::Object::BUILDARGS, avg 3µs/call |
| 21 | 20 | 54µs | $NO_BUILD{$class} and | ||
| 22 | return bless({}, $class); | ||||
| 23 | 2 | 12µs | 2 | 7µs | $NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class}; # spent 7µs making 2 calls to UNIVERSAL::can, avg 3µs/call |
| 24 | 2 | 6µs | $NO_BUILD{$class} | ||
| 25 | ? bless({}, $class) | ||||
| 26 | : bless({}, $class)->BUILDALL($proto); | ||||
| 27 | } | ||||
| 28 | |||||
| 29 | # Inlined into Method::Generate::Constructor::_generate_args() - keep in sync | ||||
| 30 | # spent 6.61ms within Moo::Object::BUILDARGS which was called 1022 times, avg 6µs/call:
# 1001 times (6.56ms+0s) by Search::Elasticsearch::Role::CxnPool::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Search/Elasticsearch/Role/CxnPool.pm:33] at line 26 of Search/Elasticsearch/Role/CxnPool.pm, avg 7µs/call
# 20 times (52µs+0s) by Moo::Object::new at line 20, avg 3µs/call
# once (2µs+0s) by Method::Generate::Constructor::new at line 243 of Method/Generate/Constructor.pm | ||||
| 31 | 1022 | 487µs | my $class = shift; | ||
| 32 | 1022 | 742µs | if ( scalar @_ == 1 ) { | ||
| 33 | 1001 | 902µs | unless ( defined $_[0] && ref $_[0] eq 'HASH' ) { | ||
| 34 | die "Single parameters to new() must be a HASH ref" | ||||
| 35 | ." data => ". $_[0] ."\n"; | ||||
| 36 | } | ||||
| 37 | 1001 | 5.86ms | return { %{ $_[0] } }; | ||
| 38 | } | ||||
| 39 | elsif ( @_ % 2 ) { | ||||
| 40 | die "The new() method for $class expects a hash reference or a" | ||||
| 41 | . " key/value list. You passed an odd number of arguments\n"; | ||||
| 42 | } | ||||
| 43 | else { | ||||
| 44 | 21 | 47µs | return {@_}; | ||
| 45 | } | ||||
| 46 | } | ||||
| 47 | |||||
| 48 | sub BUILDALL { | ||||
| 49 | my $self = shift; | ||||
| 50 | $self->${\(($BUILD_MAKER ||= do { | ||||
| 51 | require Method::Generate::BuildAll; | ||||
| 52 | Method::Generate::BuildAll->new | ||||
| 53 | })->generate_method(ref($self)))}(@_); | ||||
| 54 | } | ||||
| 55 | |||||
| 56 | sub DEMOLISHALL { | ||||
| 57 | my $self = shift; | ||||
| 58 | $self->${\(($DEMOLISH_MAKER ||= do { | ||||
| 59 | require Method::Generate::DemolishAll; | ||||
| 60 | Method::Generate::DemolishAll->new | ||||
| 61 | })->generate_method(ref($self)))}(@_); | ||||
| 62 | } | ||||
| 63 | |||||
| 64 | # spent 20µs (19+700ns) within Moo::Object::does which was called:
# once (19µs+700ns) by Search::Elasticsearch::Util::is_compat at line 96 of Search/Elasticsearch/Util.pm | ||||
| 65 | return !!0 | ||||
| 66 | 1 | 2µs | unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'}); | ||
| 67 | 1 | 600ns | require Moo::Role; | ||
| 68 | 1 | 4µs | 1 | 700ns | my $does = Moo::Role->can("does_role"); # spent 700ns making 1 call to UNIVERSAL::can |
| 69 | 4 | 63µs | 2 | 21µs | # spent 14µs (6+7) within Moo::Object::BEGIN@69 which was called:
# once (6µs+7µs) by Moo::import at line 69 # spent 14µs making 1 call to Moo::Object::BEGIN@69
# spent 7µs making 1 call to warnings::unimport |
| 70 | 1 | 4µs | 1 | 11µs | goto &$does; # spent 11µs making 1 call to Moo::Role::does_role |
| 71 | } | ||||
| 72 | |||||
| 73 | # duplicated in Moo::Role | ||||
| 74 | sub meta { | ||||
| 75 | require Moo::HandleMoose::FakeMetaClass; | ||||
| 76 | my $class = ref($_[0])||$_[0]; | ||||
| 77 | bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass'); | ||||
| 78 | } | ||||
| 79 | |||||
| 80 | 1 | 2µs | 1; |