Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm |
Statements | Executed 1154 statements in 2.87ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
26 | 1 | 1 | 409µs | 32.4ms | _initialize_body | Moose::Meta::Method::Accessor::Native::
26 | 2 | 2 | 406µs | 7.35ms | _inline_check_argument_count | Moose::Meta::Method::Accessor::Native::
65 | 3 | 2 | 284µs | 929µs | _slot_access_can_be_inlined | Moose::Meta::Method::Accessor::Native::
26 | 1 | 1 | 182µs | 2.41ms | __ANON__[:156] | Moose::Meta::Method::Accessor::Native::
26 | 1 | 1 | 122µs | 1.41ms | __ANON__[:125] | Moose::Meta::Method::Accessor::Native::
26 | 2 | 2 | 103µs | 127µs | _inline_curried_arguments | Moose::Meta::Method::Accessor::Native::
26 | 2 | 2 | 101µs | 141µs | _inline_return_value | Moose::Meta::Method::Accessor::Native::
26 | 1 | 1 | 65µs | 65µs | _new | Moose::Meta::Method::Accessor::Native::
21 | 1 | 1 | 19µs | 19µs | root_types | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 9µs | 1.78ms | BEGIN@15 | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 9µs | 9µs | BEGIN@2 | Moose::Meta::Method::Accessor::Native::
17 | 1 | 1 | 8µs | 8µs | _minimum_arguments | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 8µs | 31µs | BEGIN@13 | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 7µs | 78µs | BEGIN@164 | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 7µs | 29µs | BEGIN@12 | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 6µs | 10µs | BEGIN@10 | Moose::Meta::Method::Accessor::Native::
1 | 1 | 1 | 6µs | 16µs | BEGIN@9 | Moose::Meta::Method::Accessor::Native::
4 | 1 | 1 | 3µs | 3µs | _maximum_arguments | Moose::Meta::Method::Accessor::Native::
0 | 0 | 0 | 0s | 0s | __ANON__[:134] | Moose::Meta::Method::Accessor::Native::
0 | 0 | 0 | 0s | 0s | __ANON__[:43] | Moose::Meta::Method::Accessor::Native::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Method::Accessor::Native; | ||||
2 | # spent 9µs within Moose::Meta::Method::Accessor::Native::BEGIN@2 which was called:
# once (9µs+0s) by Module::Runtime::require_module at line 4 | ||||
3 | 1 | 4µs | $Moose::Meta::Method::Accessor::Native::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 31µs | 1 | 9µs | } # spent 9µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@2 |
5 | { | ||||
6 | 2 | 700ns | $Moose::Meta::Method::Accessor::Native::VERSION = '2.1005'; | ||
7 | } | ||||
8 | |||||
9 | 2 | 21µs | 2 | 27µs | # spent 16µs (6+10) within Moose::Meta::Method::Accessor::Native::BEGIN@9 which was called:
# once (6µs+10µs) by Module::Runtime::require_module at line 9 # spent 16µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@9
# spent 10µs making 1 call to strict::import |
10 | 2 | 22µs | 2 | 13µs | # spent 10µs (6+3) within Moose::Meta::Method::Accessor::Native::BEGIN@10 which was called:
# once (6µs+3µs) by Module::Runtime::require_module at line 10 # spent 10µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@10
# spent 3µs making 1 call to warnings::import |
11 | |||||
12 | 2 | 24µs | 2 | 52µs | # spent 29µs (7+23) within Moose::Meta::Method::Accessor::Native::BEGIN@12 which was called:
# once (7µs+23µs) by Module::Runtime::require_module at line 12 # spent 29µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@12
# spent 23µs making 1 call to Exporter::import |
13 | 2 | 25µs | 2 | 54µs | # spent 31µs (8+23) within Moose::Meta::Method::Accessor::Native::BEGIN@13 which was called:
# once (8µs+23µs) by Module::Runtime::require_module at line 13 # spent 31µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@13
# spent 23µs making 1 call to Exporter::import |
14 | |||||
15 | 2 | 677µs | 2 | 3.55ms | # spent 1.78ms (9µs+1.77) within Moose::Meta::Method::Accessor::Native::BEGIN@15 which was called:
# once (9µs+1.77ms) by Module::Runtime::require_module at line 15 # spent 1.78ms making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@15
# spent 1.77ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:519] |
16 | |||||
17 | around new => sub { | ||||
18 | 26 | 3µs | my $orig = shift; | ||
19 | 26 | 3µs | my $class = shift; | ||
20 | 26 | 47µs | my %options = @_; | ||
21 | |||||
22 | 26 | 7µs | $options{curried_arguments} = [] | ||
23 | unless exists $options{curried_arguments}; | ||||
24 | |||||
25 | 26 | 11µs | confess 'You must supply a curried_arguments which is an ARRAY reference' | ||
26 | unless $options{curried_arguments} | ||||
27 | && ref($options{curried_arguments}) eq 'ARRAY'; | ||||
28 | |||||
29 | 26 | 65µs | 26 | 16µs | my $attr_context = $options{attribute}->definition_context; # spent 16µs making 26 calls to Class::MOP::Mixin::AttributeCore::definition_context, avg 596ns/call |
30 | 26 | 3µs | my $desc = 'native delegation method '; | ||
31 | 26 | 89µs | 52 | 21µs | $desc .= $options{attribute}->associated_class->name; # spent 11µs making 26 calls to Class::MOP::Attribute::associated_class, avg 408ns/call
# spent 10µs making 26 calls to Class::MOP::Package::name, avg 388ns/call |
32 | 26 | 8µs | $desc .= '::' . $options{name}; | ||
33 | 26 | 6µs | $desc .= " ($options{delegate_to_method})"; | ||
34 | 26 | 53µs | 26 | 10µs | $desc .= " of attribute " . $options{attribute}->name; # spent 10µs making 26 calls to Class::MOP::Mixin::AttributeCore::name, avg 404ns/call |
35 | $options{definition_context} = { | ||||
36 | 26 | 77µs | %{ $attr_context || {} }, | ||
37 | description => $desc, | ||||
38 | }; | ||||
39 | |||||
40 | 26 | 8µs | $options{accessor_type} = 'native'; | ||
41 | |||||
42 | 26 | 102µs | 26 | 38µs | return $class->$orig(%options); # spent 38µs making 26 calls to Moose::Meta::Method::Accessor::new, avg 1µs/call |
43 | 1 | 4µs | 1 | 46µs | }; # spent 46µs making 1 call to Moose::Role::around |
44 | |||||
45 | # spent 65µs within Moose::Meta::Method::Accessor::Native::_new which was called 26 times, avg 3µs/call:
# 26 times (65µs+0s) by Class::MOP::Method::Accessor::new at line 35 of Class/MOP/Method/Accessor.pm, avg 3µs/call | ||||
46 | 26 | 5µs | my $class = shift; | ||
47 | 26 | 8µs | my $options = @_ == 1 ? $_[0] : {@_}; | ||
48 | |||||
49 | 26 | 67µs | return bless $options, $class; | ||
50 | } | ||||
51 | |||||
52 | 21 | 34µs | # spent 19µs within Moose::Meta::Method::Accessor::Native::root_types which was called 21 times, avg 886ns/call:
# 21 times (19µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_is_root_type at line 107 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 886ns/call | ||
53 | |||||
54 | # spent 32.4ms (409µs+32.0) within Moose::Meta::Method::Accessor::Native::_initialize_body which was called 26 times, avg 1.25ms/call:
# 26 times (409µs+32.0ms) by Class::MOP::Method::Accessor::new at line 42 of Class/MOP/Method/Accessor.pm, avg 1.25ms/call | ||||
55 | 26 | 3µs | my $self = shift; | ||
56 | |||||
57 | 26 | 336µs | 52 | 32.0ms | $self->{'body'} = $self->_compile_code( [$self->_generate_method] ); # spent 12.2ms making 26 calls to Moose::Meta::Method::Accessor::_compile_code, avg 471µs/call
# spent 10.5ms making 13 calls to Moose::Meta::Method::Accessor::Native::Reader::_generate_method, avg 808µs/call
# spent 9.22ms making 13 calls to Moose::Meta::Method::Accessor::Native::Writer::_generate_method, avg 709µs/call |
58 | |||||
59 | 26 | 42µs | return; | ||
60 | } | ||||
61 | |||||
62 | # spent 127µs (103+24) within Moose::Meta::Method::Accessor::Native::_inline_curried_arguments which was called 26 times, avg 5µs/call:
# 13 times (54µs+12µs) by Moose::Meta::Method::Accessor::Native::Writer::_generate_method at line 28 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 5µs/call
# 13 times (49µs+13µs) by Moose::Meta::Method::Accessor::Native::Reader::_generate_method at line 25 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 5µs/call | ||||
63 | 26 | 3µs | my $self = shift; | ||
64 | |||||
65 | 26 | 90µs | 26 | 24µs | return unless @{ $self->curried_arguments }; # spent 24µs making 26 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 931ns/call |
66 | |||||
67 | return 'unshift @_, @curried;'; | ||||
68 | } | ||||
69 | |||||
70 | # spent 7.35ms (406µs+6.95) within Moose::Meta::Method::Accessor::Native::_inline_check_argument_count which was called 26 times, avg 283µs/call:
# 13 times (207µs+5.58ms) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 38 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 445µs/call
# 13 times (199µs+1.36ms) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 44 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 120µs/call | ||||
71 | 26 | 3µs | my $self = shift; | ||
72 | |||||
73 | 26 | 1µs | my @code; | ||
74 | |||||
75 | 26 | 76µs | 44 | 884µs | if (my $min = $self->_minimum_arguments) { # spent 859µs making 9 calls to Moose::Meta::Method::_inline_throw_error, avg 95µs/call
# spent 8µs making 17 calls to Moose::Meta::Method::Accessor::Native::_minimum_arguments, avg 500ns/call
# spent 8µs making 9 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 944ns/call
# spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::set::_minimum_arguments, avg 1µs/call
# spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::get::_minimum_arguments, avg 850ns/call
# spent 800ns making 1 call to Moose::Meta::Method::Accessor::Native::Array::delete::_minimum_arguments |
76 | push @code, ( | ||||
77 | 'if (@_ < ' . $min . ') {', | ||||
78 | $self->_inline_throw_error( | ||||
79 | sprintf( | ||||
80 | '"Cannot call %s without at least %s argument%s"', | ||||
81 | $self->delegate_to_method, | ||||
82 | $min, | ||||
83 | ($min == 1 ? '' : 's'), | ||||
84 | ) | ||||
85 | ) . ';', | ||||
86 | '}', | ||||
87 | ); | ||||
88 | } | ||||
89 | |||||
90 | 26 | 140µs | 70 | 6.06ms | if (defined(my $max = $self->_maximum_arguments)) { # spent 6.01ms making 22 calls to Moose::Meta::Method::_inline_throw_error, avg 273µs/call
# spent 24µs making 22 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 1µs/call
# spent 5µs making 5 calls to Moose::Meta::Method::Accessor::Native::Array::count::_maximum_arguments, avg 920ns/call
# spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::set::_maximum_arguments, avg 1µs/call
# spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::get::_maximum_arguments, avg 925ns/call
# spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::clear::_maximum_arguments, avg 900ns/call
# spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::elements::_maximum_arguments, avg 850ns/call
# spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::_maximum_arguments, avg 850ns/call
# spent 700ns making 1 call to Moose::Meta::Method::Accessor::Native::Array::delete::_maximum_arguments |
91 | push @code, ( | ||||
92 | 'if (@_ > ' . $max . ') {', | ||||
93 | $self->_inline_throw_error( | ||||
94 | sprintf( | ||||
95 | '"Cannot call %s with %s argument%s"', | ||||
96 | $self->delegate_to_method, | ||||
97 | $max ? "more than $max" : 'any', | ||||
98 | ($max == 1 ? '' : 's'), | ||||
99 | ) | ||||
100 | ) . ';', | ||||
101 | '}', | ||||
102 | ); | ||||
103 | } | ||||
104 | |||||
105 | 26 | 74µs | return @code; | ||
106 | } | ||||
107 | |||||
108 | # spent 141µs (101+40) within Moose::Meta::Method::Accessor::Native::_inline_return_value which was called 26 times, avg 5µs/call:
# 13 times (52µs+26µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 38 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 6µs/call
# 13 times (49µs+15µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 57 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 5µs/call | ||||
109 | 26 | 3µs | my $self = shift; | ||
110 | 26 | 6µs | my ($slot_access, $for_writer) = @_; | ||
111 | |||||
112 | 26 | 65µs | 26 | 40µs | return 'return ' . $self->_return_value($slot_access, $for_writer) . ';'; # spent 10µs making 5 calls to Moose::Meta::Method::Accessor::Native::Array::count::_return_value, avg 2µs/call
# spent 8µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::elements::_return_value, avg 2µs/call
# spent 8µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::get::_return_value, avg 2µs/call
# spent 5µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::push::_return_value, avg 1µs/call
# spent 5µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::set::_return_value, avg 1µs/call
# spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::clear::_return_value, avg 650ns/call
# spent 1µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::delete::_return_value |
113 | } | ||||
114 | |||||
115 | 17 | 25µs | # spent 8µs within Moose::Meta::Method::Accessor::Native::_minimum_arguments which was called 17 times, avg 500ns/call:
# 17 times (8µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 75, avg 500ns/call | ||
116 | 4 | 7µs | # spent 3µs within Moose::Meta::Method::Accessor::Native::_maximum_arguments which was called 4 times, avg 850ns/call:
# 4 times (3µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 90, avg 850ns/call | ||
117 | |||||
118 | # spent 1.41ms (122µs+1.29) within Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:125] which was called 26 times, avg 54µs/call:
# 26 times (122µs+1.29ms) by Moose::Meta::Class::__ANON__::SERIAL::2::_get_value or Moose::Meta::Class::__ANON__::SERIAL::3::_get_value or Moose::Meta::Class::__ANON__::SERIAL::4::_get_value or Moose::Meta::Class::__ANON__::SERIAL::5::_get_value or Moose::Meta::Class::__ANON__::SERIAL::6::_get_value or Moose::Meta::Class::__ANON__::SERIAL::7::_get_value or Moose::Meta::Class::__ANON__::SERIAL::8::_get_value at line 38 of Moose/Meta/Method/Overridden.pm, avg 54µs/call | ||||
119 | 26 | 3µs | my $self = shift; | ||
120 | 26 | 5µs | my ($instance) = @_; | ||
121 | |||||
122 | 26 | 91µs | 52 | 1.29ms | return $self->_slot_access_can_be_inlined # spent 878µs making 26 calls to Moose::Role::super, avg 34µs/call
# spent 408µs making 26 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 16µs/call |
123 | ? super() | ||||
124 | : $instance . '->$reader'; | ||||
125 | 1 | 2µs | 1 | 56µs | }; # spent 56µs making 1 call to Moose::Role::override |
126 | |||||
127 | override _inline_store_value => sub { | ||||
128 | my $self = shift; | ||||
129 | my ($instance, $value) = @_; | ||||
130 | |||||
131 | return $self->_slot_access_can_be_inlined | ||||
132 | ? super() | ||||
133 | : $instance . '->$writer(' . $value . ');'; | ||||
134 | 1 | 2µs | 1 | 34µs | }; # spent 34µs making 1 call to Moose::Role::override |
135 | |||||
136 | # spent 2.41ms (182µs+2.23) within Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:156] which was called 26 times, avg 93µs/call:
# 26 times (182µs+2.23ms) by Moose::Meta::Class::__ANON__::SERIAL::2::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::3::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::4::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::5::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::6::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::7::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::8::_eval_environment at line 38 of Moose/Meta/Method/Overridden.pm, avg 93µs/call | ||||
137 | 26 | 3µs | my $self = shift; | ||
138 | |||||
139 | 26 | 18µs | 26 | 1.85ms | my $env = super(); # spent 1.85ms making 26 calls to Moose::Role::super, avg 71µs/call |
140 | |||||
141 | 26 | 30µs | 26 | 26µs | $env->{'@curried'} = $self->curried_arguments; # spent 26µs making 26 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 985ns/call |
142 | |||||
143 | 26 | 72µs | 26 | 353µs | return $env if $self->_slot_access_can_be_inlined; # spent 353µs making 26 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 14µs/call |
144 | |||||
145 | my $reader = $self->associated_attribute->get_read_method_ref; | ||||
146 | $reader = $reader->body if blessed $reader; | ||||
147 | |||||
148 | $env->{'$reader'} = \$reader; | ||||
149 | |||||
150 | my $writer = $self->associated_attribute->get_write_method_ref; | ||||
151 | $writer = $writer->body if blessed $writer; | ||||
152 | |||||
153 | $env->{'$writer'} = \$writer; | ||||
154 | |||||
155 | return $env; | ||||
156 | 1 | 2µs | 1 | 31µs | }; # spent 31µs making 1 call to Moose::Role::override |
157 | |||||
158 | # spent 929µs (284+645) within Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined which was called 65 times, avg 14µs/call:
# 26 times (134µs+274µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:125] at line 122, avg 16µs/call
# 26 times (103µs+250µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:156] at line 143, avg 14µs/call
# 13 times (47µs+121µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 149 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 13µs/call | ||||
159 | 65 | 5µs | my $self = shift; | ||
160 | |||||
161 | 65 | 314µs | 130 | 645µs | return $self->is_inline && $self->_instance_is_inlinable; # spent 611µs making 65 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 9µs/call
# spent 34µs making 65 calls to Class::MOP::Method::Generated::is_inline, avg 523ns/call |
162 | } | ||||
163 | |||||
164 | 2 | 30µs | 2 | 148µs | # spent 78µs (7+70) within Moose::Meta::Method::Accessor::Native::BEGIN@164 which was called:
# once (7µs+70µs) by Module::Runtime::require_module at line 164 # spent 78µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@164
# spent 70µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:706] |
165 | |||||
166 | 1 | 9µs | 1; |