Filename | /usr/local/share/perl/5.18.2/Moo/Object.pm |
Statements | Executed 41 statements in 846µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 386µs | 438µs | meta | Moo::Object::
2 | 1 | 1 | 46µs | 63µs | new | Moo::Object::
5 | 3 | 3 | 32µs | 32µs | BUILDARGS | Moo::Object::
8 | 1 | 1 | 15µs | 15µs | does | Moo::Object::
1 | 1 | 1 | 14µs | 43µs | BEGIN@3 | Moo::Object::
1 | 1 | 1 | 12µs | 25µs | BEGIN@65 | Moo::Object::
0 | 0 | 0 | 0s | 0s | BUILDALL | Moo::Object::
0 | 0 | 0 | 0s | 0s | DEMOLISHALL | Moo::Object::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moo::Object; | ||||
2 | |||||
3 | 2 | 509µs | 2 | 71µs | # spent 43µs (14+29) within Moo::Object::BEGIN@3 which was called:
# once (14µs+29µs) by Moo::import at line 3 # spent 43µs making 1 call to Moo::Object::BEGIN@3
# spent 29µs making 1 call to Moo::_strictures::import |
4 | |||||
5 | 1 | 400ns | our %NO_BUILD; | ||
6 | 1 | 200ns | our %NO_DEMOLISH; | ||
7 | 1 | 200ns | our $BUILD_MAKER; | ||
8 | 1 | 100ns | our $DEMOLISH_MAKER; | ||
9 | |||||
10 | # spent 63µs (46+17) within Moo::Object::new which was called 2 times, avg 32µs/call:
# 2 times (46µs+17µs) by Moo::_accessor_maker_for at line 147 of Moo.pm, avg 32µs/call | ||||
11 | 2 | 1µs | my $class = shift; | ||
12 | 2 | 2µs | unless (exists $NO_DEMOLISH{$class}) { | ||
13 | 1 | 12µs | 1 | 3µs | unless ($NO_DEMOLISH{$class} = !$class->can('DEMOLISH')) { # spent 3µs making 1 call to UNIVERSAL::can |
14 | ($DEMOLISH_MAKER ||= do { | ||||
15 | require Method::Generate::DemolishAll; | ||||
16 | Method::Generate::DemolishAll->new | ||||
17 | })->generate_method($class); | ||||
18 | } | ||||
19 | } | ||||
20 | 2 | 8µs | 2 | 9µs | my $proto = $class->BUILDARGS(@_); # spent 9µs making 2 calls to Moo::Object::BUILDARGS, avg 5µs/call |
21 | 2 | 8µs | $NO_BUILD{$class} and | ||
22 | return bless({}, $class); | ||||
23 | 1 | 12µs | 1 | 4µs | $NO_BUILD{$class} = !$class->can('BUILD') unless exists $NO_BUILD{$class}; # spent 4µs making 1 call to UNIVERSAL::can |
24 | 1 | 10µ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 32µs within Moo::Object::BUILDARGS which was called 5 times, avg 6µs/call:
# 2 times (16µs+0s) by String::Markov::__ANON__[/usr/local/share/perl/5.18.2/String/Markov.pm:45] at line 44 of String/Markov.pm, avg 8µs/call
# 2 times (9µs+0s) by Moo::Object::new at line 20, avg 5µs/call
# once (8µs+0s) by Method::Generate::Constructor::new at line 242 of Method/Generate/Constructor.pm | ||||
31 | 5 | 4µs | my $class = shift; | ||
32 | scalar @_ == 1 | ||||
33 | ? ref $_[0] eq 'HASH' | ||||
34 | 5 | 43µs | ? { %{ $_[0] } } | ||
35 | : die "Single parameters to new() must be a HASH ref" | ||||
36 | . " data => ". $_[0] ."\n" | ||||
37 | : @_ % 2 | ||||
38 | ? die "The new() method for $class expects a hash reference or a" | ||||
39 | . " key/value list. You passed an odd number of arguments\n" | ||||
40 | : {@_} | ||||
41 | ; | ||||
42 | } | ||||
43 | |||||
44 | sub BUILDALL { | ||||
45 | my $self = shift; | ||||
46 | $self->${\(($BUILD_MAKER ||= do { | ||||
47 | require Method::Generate::BuildAll; | ||||
48 | Method::Generate::BuildAll->new | ||||
49 | })->generate_method(ref($self)))}(@_); | ||||
50 | } | ||||
51 | |||||
52 | sub DEMOLISHALL { | ||||
53 | my $self = shift; | ||||
54 | $self->${\(($DEMOLISH_MAKER ||= do { | ||||
55 | require Method::Generate::DemolishAll; | ||||
56 | Method::Generate::DemolishAll->new | ||||
57 | })->generate_method(ref($self)))}(@_); | ||||
58 | } | ||||
59 | |||||
60 | # spent 15µs within Moo::Object::does which was called 8 times, avg 2µs/call:
# 8 times (15µs+0s) by namespace::autoclean::__ANON__[/usr/local/share/perl/5.18.2/namespace/autoclean.pm:210] at line 208 of namespace/autoclean.pm, avg 2µs/call | ||||
61 | 8 | 28µs | return !!0 | ||
62 | unless ($INC{'Moose/Role.pm'} || $INC{'Role/Tiny.pm'}); | ||||
63 | require Moo::Role; | ||||
64 | my $does = Moo::Role->can("does_role"); | ||||
65 | 2 | 107µs | 2 | 38µs | # spent 25µs (12+13) within Moo::Object::BEGIN@65 which was called:
# once (12µs+13µs) by Moo::import at line 65 # spent 25µs making 1 call to Moo::Object::BEGIN@65
# spent 13µs making 1 call to warnings::unimport |
66 | goto &$does; | ||||
67 | } | ||||
68 | |||||
69 | # duplicated in Moo::Role | ||||
70 | # spent 438µs (386+52) within Moo::Object::meta which was called:
# once (386µs+52µs) by main::BEGIN@7 at line 194 of String/Markov.pm | ||||
71 | 1 | 86µs | require Moo::HandleMoose::FakeMetaClass; | ||
72 | 1 | 2µs | my $class = ref($_[0])||$_[0]; | ||
73 | 1 | 9µs | bless({ name => $class }, 'Moo::HandleMoose::FakeMetaClass'); | ||
74 | } | ||||
75 | |||||
76 | 1 | 3µs | 1; |