| Filename | /home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm |
| Statements | Executed 576 statements in 24.1ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 14 | 1 | 1 | 11.5ms | 11.5ms | Moose::Meta::Method::Accessor::Native::_new |
| 14 | 3 | 3 | 1.82ms | 2.45ms | Moose::Meta::Method::Accessor::Native::_inline_check_argument_count |
| 38 | 3 | 2 | 1.73ms | 5.54ms | Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined |
| 14 | 1 | 1 | 1.21ms | 72.1ms | Moose::Meta::Method::Accessor::Native::_initialize_body |
| 14 | 1 | 1 | 843µs | 6.96ms | Moose::Meta::Method::Accessor::Native::__ANON__[:145] |
| 14 | 2 | 2 | 715µs | 864µs | Moose::Meta::Method::Accessor::Native::_inline_curried_arguments |
| 14 | 2 | 2 | 594µs | 813µs | Moose::Meta::Method::Accessor::Native::_inline_return_value |
| 14 | 1 | 1 | 539µs | 5.68ms | Moose::Meta::Method::Accessor::Native::__ANON__[:114] |
| 30 | 1 | 1 | 292µs | 292µs | Moose::Meta::Method::Accessor::Native::root_types |
| 1 | 1 | 1 | 75µs | 94µs | Moose::Meta::Method::Accessor::Native::BEGIN@3 |
| 7 | 1 | 1 | 55µs | 55µs | Moose::Meta::Method::Accessor::Native::_minimum_arguments |
| 1 | 1 | 1 | 50µs | 732µs | Moose::Meta::Method::Accessor::Native::BEGIN@153 |
| 1 | 1 | 1 | 45µs | 13.5ms | Moose::Meta::Method::Accessor::Native::BEGIN@13 |
| 1 | 1 | 1 | 40µs | 108µs | Moose::Meta::Method::Accessor::Native::BEGIN@4 |
| 1 | 1 | 1 | 39µs | 201µs | Moose::Meta::Method::Accessor::Native::BEGIN@6 |
| 1 | 1 | 1 | 39µs | 216µs | Moose::Meta::Method::Accessor::Native::BEGIN@7 |
| 3 | 1 | 1 | 23µs | 23µs | Moose::Meta::Method::Accessor::Native::_maximum_arguments |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::__ANON__[:123] |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::__ANON__[:32] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Method::Accessor::Native; | ||||
| 2 | |||||
| 3 | 3 | 103µs | 2 | 112µs | # spent 94µs (75+18) within Moose::Meta::Method::Accessor::Native::BEGIN@3 which was called:
# once (75µs+18µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 3 # spent 94µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@3
# spent 18µs making 1 call to strict::import |
| 4 | 3 | 108µs | 2 | 175µs | # spent 108µs (40+68) within Moose::Meta::Method::Accessor::Native::BEGIN@4 which was called:
# once (40µs+68µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 4 # spent 108µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@4
# spent 68µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 3 | 110µs | 2 | 363µs | # spent 201µs (39+162) within Moose::Meta::Method::Accessor::Native::BEGIN@6 which was called:
# once (39µs+162µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 6 # spent 201µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@6
# spent 162µs making 1 call to Exporter::import |
| 7 | 3 | 222µs | 2 | 393µs | # spent 216µs (39+177) within Moose::Meta::Method::Accessor::Native::BEGIN@7 which was called:
# once (39µs+177µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 7 # spent 216µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@7
# spent 177µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 1 | 4µs | our $VERSION = '1.19'; | ||
| 10 | 1 | 78µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 11 | 1 | 4µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 12 | |||||
| 13 | 3 | 2.39ms | 2 | 26.9ms | # spent 13.5ms (45µs+13.4) within Moose::Meta::Method::Accessor::Native::BEGIN@13 which was called:
# once (45µs+13.4ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 13 # spent 13.5ms making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@13
# spent 13.4ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 14 | |||||
| 15 | around new => sub { | ||||
| 16 | 14 | 57µs | my $orig = shift; | ||
| 17 | 14 | 52µs | my $class = shift; | ||
| 18 | 14 | 219µs | my %options = @_; | ||
| 19 | |||||
| 20 | 14 | 44µs | $options{curried_arguments} = [] | ||
| 21 | unless exists $options{curried_arguments}; | ||||
| 22 | |||||
| 23 | 14 | 86µs | confess 'You must supply a curried_arguments which is an ARRAY reference' | ||
| 24 | unless $options{curried_arguments} | ||||
| 25 | && ref($options{curried_arguments}) eq 'ARRAY'; | ||||
| 26 | |||||
| 27 | 14 | 370µs | 14 | 105µs | $options{definition_context} = $options{attribute}->definition_context; # spent 105µs making 14 calls to Class::MOP::Mixin::AttributeCore::definition_context, avg 7µs/call |
| 28 | |||||
| 29 | 14 | 59µs | $options{accessor_type} = 'native'; | ||
| 30 | |||||
| 31 | 14 | 521µs | 14 | 85.6ms | return $class->$orig(%options); # spent 85.6ms making 14 calls to Class::MOP::Method::Accessor::new, avg 6.11ms/call |
| 32 | 1 | 23µs | 1 | 414µs | }; # spent 414µs making 1 call to Moose::Role::around |
| 33 | |||||
| 34 | # spent 11.5ms within Moose::Meta::Method::Accessor::Native::_new which was called 14 times, avg 820µs/call:
# 14 times (11.5ms+0s) by Class::MOP::Method::Accessor::new at line 33 of Class/MOP/Method/Accessor.pm, avg 820µs/call | ||||
| 35 | 14 | 54µs | my $class = shift; | ||
| 36 | 14 | 56µs | my $options = @_ == 1 ? $_[0] : {@_}; | ||
| 37 | |||||
| 38 | 14 | 11.5ms | return bless $options, $class; | ||
| 39 | } | ||||
| 40 | |||||
| 41 | 30 | 399µs | # spent 292µs within Moose::Meta::Method::Accessor::Native::root_types which was called 30 times, avg 10µs/call:
# 30 times (292µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_is_root_type at line 97 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 10µs/call | ||
| 42 | |||||
| 43 | # spent 72.1ms (1.21+70.9) within Moose::Meta::Method::Accessor::Native::_initialize_body which was called 14 times, avg 5.15ms/call:
# 14 times (1.21ms+70.9ms) by Class::MOP::Method::Accessor::new at line 40 of Class/MOP/Method/Accessor.pm, avg 5.15ms/call | ||||
| 44 | 14 | 42µs | my $self = shift; | ||
| 45 | |||||
| 46 | 14 | 948µs | 28 | 70.9ms | $self->{'body'} = $self->_compile_code( [$self->_generate_method] ); # spent 34.6ms making 14 calls to Moose::Meta::Method::Accessor::_compile_code, avg 2.47ms/call
# spent 32.0ms making 10 calls to Moose::Meta::Method::Accessor::Native::Writer::_generate_method, avg 3.20ms/call
# spent 4.28ms making 4 calls to Moose::Meta::Method::Accessor::Native::Reader::_generate_method, avg 1.07ms/call |
| 47 | |||||
| 48 | 14 | 192µs | return; | ||
| 49 | } | ||||
| 50 | |||||
| 51 | # spent 864µs (715+149) within Moose::Meta::Method::Accessor::Native::_inline_curried_arguments which was called 14 times, avg 62µs/call:
# 10 times (532µs+108µs) by Moose::Meta::Method::Accessor::Native::Writer::_generate_method at line 25 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 64µs/call
# 4 times (182µs+41µs) by Moose::Meta::Method::Accessor::Native::Reader::_generate_method at line 23 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 56µs/call | ||||
| 52 | 14 | 43µs | my $self = shift; | ||
| 53 | |||||
| 54 | 14 | 646µs | 14 | 150µs | return unless @{ $self->curried_arguments }; # spent 150µs making 14 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 11µs/call |
| 55 | |||||
| 56 | return 'unshift @_, @curried;'; | ||||
| 57 | } | ||||
| 58 | |||||
| 59 | # spent 2.45ms (1.82+629µs) within Moose::Meta::Method::Accessor::Native::_inline_check_argument_count which was called 14 times, avg 175µs/call:
# 8 times (1.07ms+360µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 41 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 178µs/call
# 4 times (504µs+179µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 36 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 171µs/call
# 2 times (250µs+91µs) by Class::MOP::Class:::around at line 38 of Moose/Meta/Method/Accessor/Native/Hash/set.pm, avg 170µs/call | ||||
| 60 | 14 | 35µs | my $self = shift; | ||
| 61 | |||||
| 62 | 14 | 26µs | my @code; | ||
| 63 | |||||
| 64 | 14 | 461µs | 24 | 256µs | if (my $min = $self->_minimum_arguments) { # spent 86µs making 5 calls to Moose::Meta::Method::_inline_throw_error, avg 17µs/call
# spent 56µs making 5 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 11µs/call
# spent 55µs making 7 calls to Moose::Meta::Method::Accessor::Native::_minimum_arguments, avg 8µs/call
# spent 17µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::get::_minimum_arguments, avg 8µs/call
# spent 16µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_minimum_arguments, avg 8µs/call
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::dec::_minimum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::inc::_minimum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::String::append::_minimum_arguments |
| 65 | push @code, ( | ||||
| 66 | 'if (@_ < ' . $min . ') {', | ||||
| 67 | $self->_inline_throw_error( | ||||
| 68 | sprintf( | ||||
| 69 | '"Cannot call %s without at least %s argument%s"', | ||||
| 70 | $self->delegate_to_method, | ||||
| 71 | $min, | ||||
| 72 | ($min == 1 ? '' : 's'), | ||||
| 73 | ) | ||||
| 74 | ) . ';', | ||||
| 75 | '}', | ||||
| 76 | ); | ||||
| 77 | } | ||||
| 78 | |||||
| 79 | 14 | 783µs | 32 | 373µs | if (defined(my $max = $self->_maximum_arguments)) { # spent 153µs making 9 calls to Moose::Meta::Method::_inline_throw_error, avg 17µs/call
# spent 103µs making 9 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 11µs/call
# spent 23µs making 3 calls to Moose::Meta::Method::Accessor::Native::_maximum_arguments, avg 8µs/call
# spent 17µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_maximum_arguments, avg 9µs/call
# spent 11µs making 1 call to Moose::Meta::Method::Accessor::Native::Bool::unset::_maximum_arguments
# spent 9µs making 1 call to Moose::Meta::Method::Accessor::Native::String::length::_maximum_arguments
# spent 9µs making 1 call to Moose::Meta::Method::Accessor::Native::Bool::set::_maximum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::String::append::_maximum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::elements::_maximum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::clear::_maximum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::dec::_maximum_arguments
# spent 8µs making 1 call to Moose::Meta::Method::Accessor::Native::String::clear::_maximum_arguments
# spent 7µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::inc::_maximum_arguments |
| 80 | push @code, ( | ||||
| 81 | 'if (@_ > ' . $max . ') {', | ||||
| 82 | $self->_inline_throw_error( | ||||
| 83 | sprintf( | ||||
| 84 | '"Cannot call %s with %s argument%s"', | ||||
| 85 | $self->delegate_to_method, | ||||
| 86 | $max ? "more than $max" : 'any', | ||||
| 87 | ($max == 1 ? '' : 's'), | ||||
| 88 | ) | ||||
| 89 | ) . ';', | ||||
| 90 | '}', | ||||
| 91 | ); | ||||
| 92 | } | ||||
| 93 | |||||
| 94 | 14 | 242µs | return @code; | ||
| 95 | } | ||||
| 96 | |||||
| 97 | # spent 813µs (594+218) within Moose::Meta::Method::Accessor::Native::_inline_return_value which was called 14 times, avg 58µs/call:
# 10 times (421µs+142µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 54 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 56µs/call
# 4 times (173µs+76µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 36 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 62µs/call | ||||
| 98 | 14 | 45µs | my $self = shift; | ||
| 99 | 14 | 59µs | my ($slot_access, $for_writer) = @_; | ||
| 100 | |||||
| 101 | 14 | 348µs | 14 | 218µs | return 'return ' . $self->_return_value($slot_access, $for_writer) . ';'; # spent 83µs making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_return_value, avg 14µs/call
# spent 37µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::get::_return_value, avg 19µs/call
# spent 34µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_return_value, avg 17µs/call
# spent 19µs making 1 call to Moose::Meta::Method::Accessor::Native::String::length::_return_value
# spent 19µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::elements::_return_value
# spent 17µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::push::_return_value
# spent 9µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::clear::_return_value |
| 102 | } | ||||
| 103 | |||||
| 104 | 7 | 96µs | # spent 55µs within Moose::Meta::Method::Accessor::Native::_minimum_arguments which was called 7 times, avg 8µs/call:
# 7 times (55µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 64, avg 8µs/call | ||
| 105 | 3 | 55µs | # spent 23µs within Moose::Meta::Method::Accessor::Native::_maximum_arguments which was called 3 times, avg 8µs/call:
# 3 times (23µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 79, avg 8µs/call | ||
| 106 | |||||
| 107 | # spent 5.68ms (539µs+5.14) within Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:114] which was called 14 times, avg 406µs/call:
# 14 times (539µs+5.14ms) by Class::MOP::Class::__ANON__::SERIAL::10::_get_value or Class::MOP::Class::__ANON__::SERIAL::12::_get_value or Class::MOP::Class::__ANON__::SERIAL::13::_get_value or Class::MOP::Class::__ANON__::SERIAL::16::_get_value or Class::MOP::Class::__ANON__::SERIAL::17::_get_value or Class::MOP::Class::__ANON__::SERIAL::18::_get_value or Class::MOP::Class::__ANON__::SERIAL::20::_get_value or Class::MOP::Class::__ANON__::SERIAL::21::_get_value or Class::MOP::Class::__ANON__::SERIAL::22::_get_value or Class::MOP::Class::__ANON__::SERIAL::6::_get_value or Class::MOP::Class::__ANON__::SERIAL::7::_get_value or Class::MOP::Class::__ANON__::SERIAL::9::_get_value at line 36 of Moose/Meta/Method/Overridden.pm, avg 406µs/call | ||||
| 108 | 14 | 40µs | my $self = shift; | ||
| 109 | 14 | 48µs | my ($instance) = @_; | ||
| 110 | |||||
| 111 | 14 | 502µs | 28 | 5.14ms | return $self->_slot_access_can_be_inlined # spent 2.70ms making 14 calls to Moose::Role::super, avg 193µs/call
# spent 2.44ms making 14 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 174µs/call |
| 112 | ? super() | ||||
| 113 | : $instance . '->$reader'; | ||||
| 114 | 1 | 19µs | 1 | 444µs | }; # spent 444µs making 1 call to Moose::Role::override |
| 115 | |||||
| 116 | override _inline_store_value => sub { | ||||
| 117 | my $self = shift; | ||||
| 118 | my ($instance, $value) = @_; | ||||
| 119 | |||||
| 120 | return $self->_slot_access_can_be_inlined | ||||
| 121 | ? super() | ||||
| 122 | : $instance . '->$writer(' . $value . ');'; | ||||
| 123 | 1 | 19µs | 1 | 284µs | }; # spent 284µs making 1 call to Moose::Role::override |
| 124 | |||||
| 125 | # spent 6.96ms (843µs+6.11) within Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:145] which was called 14 times, avg 497µs/call:
# 14 times (843µs+6.11ms) by Class::MOP::Class::__ANON__::SERIAL::10::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::12::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::13::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::16::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::17::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::18::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::20::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::21::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::22::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::6::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::7::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::9::_eval_environment at line 36 of Moose/Meta/Method/Overridden.pm, avg 497µs/call | ||||
| 126 | 14 | 42µs | my $self = shift; | ||
| 127 | |||||
| 128 | 14 | 164µs | 14 | 4.15ms | my $env = super(); # spent 4.15ms making 14 calls to Moose::Role::super, avg 296µs/call |
| 129 | |||||
| 130 | 14 | 287µs | 14 | 232µs | $env->{'@curried'} = $self->curried_arguments; # spent 232µs making 14 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 17µs/call |
| 131 | |||||
| 132 | 14 | 445µs | 14 | 1.74ms | return $env if $self->_slot_access_can_be_inlined; # spent 1.74ms making 14 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 124µs/call |
| 133 | |||||
| 134 | my $reader = $self->associated_attribute->get_read_method_ref; | ||||
| 135 | $reader = $reader->body if blessed $reader; | ||||
| 136 | |||||
| 137 | $env->{'$reader'} = \$reader; | ||||
| 138 | |||||
| 139 | my $writer = $self->associated_attribute->get_write_method_ref; | ||||
| 140 | $writer = $writer->body if blessed $writer; | ||||
| 141 | |||||
| 142 | $env->{'$writer'} = \$writer; | ||||
| 143 | |||||
| 144 | return $env; | ||||
| 145 | 1 | 20µs | 1 | 275µs | }; # spent 275µs making 1 call to Moose::Role::override |
| 146 | |||||
| 147 | # spent 5.54ms (1.73+3.81) within Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined which was called 38 times, avg 146µs/call:
# 14 times (866µs+1.57ms) by Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:114] at line 111, avg 174µs/call
# 14 times (457µs+1.28ms) by Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:145] at line 132, avg 124µs/call
# 10 times (409µs+956µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 150 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 136µs/call | ||||
| 148 | 38 | 107µs | my $self = shift; | ||
| 149 | |||||
| 150 | 38 | 1.81ms | 76 | 3.81ms | return $self->is_inline && $self->_instance_is_inlinable; # spent 3.57ms making 38 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 94µs/call
# spent 242µs making 38 calls to Class::MOP::Method::Generated::is_inline, avg 6µs/call |
| 151 | } | ||||
| 152 | |||||
| 153 | 3 | 128µs | 2 | 1.41ms | # spent 732µs (50+681) within Moose::Meta::Method::Accessor::Native::BEGIN@153 which was called:
# once (50µs+681µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 153 # spent 732µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@153
# spent 682µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557] |
| 154 | |||||
| 155 | 1 | 53µs | 1; |