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