| Filename | /home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Meta/Method/Accessor/Native/Writer.pm |
| Statements | Executed 728 statements in 16.2ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 10 | 1 | 1 | 3.50ms | 32.7ms | Moose::Meta::Method::Accessor::Native::Writer::_writer_core |
| 42 | 2 | 2 | 2.79ms | 8.61ms | Moose::Meta::Method::Accessor::Native::Writer::_is_root_type |
| 30 | 4 | 2 | 2.55ms | 11.4ms | Moose::Meta::Method::Accessor::Native::Writer::_constraint_must_be_checked |
| 10 | 1 | 1 | 1.51ms | 40.0ms | Moose::Meta::Method::Accessor::Native::Writer::_generate_method |
| 10 | 1 | 1 | 965µs | 9.66ms | Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value |
| 10 | 1 | 1 | 661µs | 1.03ms | Moose::Meta::Method::Accessor::Native::Writer::_inline_get_is_lvalue |
| 10 | 1 | 1 | 284µs | 7.26ms | Moose::Meta::Method::Accessor::Native::Writer::_inline_copy_native_value |
| 12 | 2 | 1 | 261µs | 5.14ms | Moose::Meta::Method::Accessor::Native::Writer::_value_needs_copy |
| 12 | 2 | 1 | 218µs | 218µs | Moose::Meta::Method::Accessor::Native::Writer::_return_value |
| 6 | 1 | 1 | 176µs | 2.42ms | Moose::Meta::Method::Accessor::Native::Writer::_inline_tc_code |
| 10 | 1 | 1 | 100µs | 100µs | Moose::Meta::Method::Accessor::Native::Writer::_inline_capture_return_value |
| 1 | 1 | 1 | 80µs | 98µs | Moose::Meta::Method::Accessor::Native::Writer::BEGIN@3 |
| 8 | 1 | 1 | 72µs | 72µs | Moose::Meta::Method::Accessor::Native::Writer::_inline_process_arguments |
| 8 | 1 | 1 | 68µs | 68µs | Moose::Meta::Method::Accessor::Native::Writer::_inline_check_arguments |
| 1 | 1 | 1 | 58µs | 16.5ms | Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12 |
| 6 | 1 | 1 | 53µs | 53µs | Moose::Meta::Method::Accessor::Native::Writer::_inline_coerce_new_values |
| 1 | 1 | 1 | 50µs | 822µs | Moose::Meta::Method::Accessor::Native::Writer::BEGIN@187 |
| 1 | 1 | 1 | 39µs | 106µs | Moose::Meta::Method::Accessor::Native::Writer::BEGIN@4 |
| 1 | 1 | 1 | 39µs | 249µs | Moose::Meta::Method::Accessor::Native::Writer::BEGIN@6 |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::Writer::__ANON__[:110] |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::Writer::__ANON__[:154] |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::Writer::_inline_check_coercion |
| 0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::Native::Writer::_inline_optimized_set_new_value |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Meta::Method::Accessor::Native::Writer; | ||||
| 2 | |||||
| 3 | 3 | 100µs | 2 | 115µs | # spent 98µs (80+17) within Moose::Meta::Method::Accessor::Native::Writer::BEGIN@3 which was called:
# once (80µs+17µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 3 # spent 98µs making 1 call to Moose::Meta::Method::Accessor::Native::Writer::BEGIN@3
# spent 17µs making 1 call to strict::import |
| 4 | 3 | 109µs | 2 | 173µs | # spent 106µs (39+67) within Moose::Meta::Method::Accessor::Native::Writer::BEGIN@4 which was called:
# once (39µs+67µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 4 # spent 106µs making 1 call to Moose::Meta::Method::Accessor::Native::Writer::BEGIN@4
# spent 67µs making 1 call to warnings::import |
| 5 | |||||
| 6 | 3 | 358µs | 2 | 459µs | # spent 249µs (39+210) within Moose::Meta::Method::Accessor::Native::Writer::BEGIN@6 which was called:
# once (39µs+210µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 6 # spent 249µs making 1 call to Moose::Meta::Method::Accessor::Native::Writer::BEGIN@6
# spent 210µs making 1 call to Exporter::import |
| 7 | |||||
| 8 | 1 | 4µs | our $VERSION = '1.19'; | ||
| 9 | 1 | 84µs | $VERSION = eval $VERSION; # spent 11µs executing statements in string eval | ||
| 10 | 1 | 3µs | our $AUTHORITY = 'cpan:STEVAN'; | ||
| 11 | |||||
| 12 | 3 | 3.18ms | 2 | 32.9ms | # spent 16.5ms (58µs+16.4) within Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12 which was called:
# once (58µs+16.4ms) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 12 # spent 16.5ms making 1 call to Moose::Meta::Method::Accessor::Native::Writer::BEGIN@12
# spent 16.4ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456] |
| 13 | |||||
| 14 | 1 | 20µs | 1 | 38.4ms | with 'Moose::Meta::Method::Accessor::Native'; # spent 38.4ms making 1 call to Moose::Role::with |
| 15 | |||||
| 16 | 1 | 12µs | 1 | 326µs | requires '_potential_value'; # spent 326µs making 1 call to Moose::Role::requires |
| 17 | |||||
| 18 | # spent 40.0ms (1.51+38.5) within Moose::Meta::Method::Accessor::Native::Writer::_generate_method which was called 10 times, avg 4.00ms/call:
# 10 times (1.51ms+38.5ms) by Moose::Meta::Method::Accessor::Native::_initialize_body at line 48 of Moose/Meta/Method/Accessor/Native.pm, avg 4.00ms/call | ||||
| 19 | 10 | 33µs | my $self = shift; | ||
| 20 | |||||
| 21 | 10 | 32µs | my $inv = '$self'; | ||
| 22 | |||||
| 23 | 10 | 144µs | 10 | 4.99ms | my $slot_access = $self->_inline_get($inv); # spent 889µs making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_inline_get, avg 445µs/call
# spent 612µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::12::_inline_get
# spent 538µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::21::_inline_get
# spent 523µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::20::_inline_get
# spent 510µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::13::_inline_get
# spent 494µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::17::_inline_get
# spent 478µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::18::_inline_get
# spent 474µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::10::_inline_get
# spent 473µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::9::_inline_get |
| 24 | |||||
| 25 | 10 | 32µs | my $code = 'sub {'; | ||
| 26 | |||||
| 27 | 10 | 288µs | 10 | 96µs | $code .= "\n" . $self->_inline_pre_body(@_); # spent 96µs making 10 calls to Moose::Meta::Method::Accessor::_inline_pre_body, avg 10µs/call |
| 28 | |||||
| 29 | 10 | 29µs | $code .= "\n" . 'my $self = shift;'; | ||
| 30 | |||||
| 31 | 10 | 165µs | 10 | 603µs | $code .= "\n" . $self->_inline_curried_arguments; # spent 603µs making 10 calls to Moose::Meta::Method::Accessor::Native::_inline_curried_arguments, avg 60µs/call |
| 32 | |||||
| 33 | 10 | 187µs | 10 | 32.7ms | $code .= $self->_writer_core( $inv, $slot_access ); # spent 32.7ms making 10 calls to Moose::Meta::Method::Accessor::Native::Writer::_writer_core, avg 3.27ms/call |
| 34 | |||||
| 35 | 10 | 261µs | 10 | 100µs | $code .= "\n" . $self->_inline_post_body(@_); # spent 100µs making 10 calls to Moose::Meta::Method::Accessor::_inline_post_body, avg 10µs/call |
| 36 | |||||
| 37 | 10 | 23µs | $code .= "\n}"; | ||
| 38 | |||||
| 39 | 10 | 153µs | return $code; | ||
| 40 | } | ||||
| 41 | |||||
| 42 | # spent 32.7ms (3.50+29.2) within Moose::Meta::Method::Accessor::Native::Writer::_writer_core which was called 10 times, avg 3.27ms/call:
# 10 times (3.50ms+29.2ms) by Moose::Meta::Method::Accessor::Native::Writer::_generate_method at line 33, avg 3.27ms/call | ||||
| 43 | 10 | 54µs | my ( $self, $inv, $slot_access ) = @_; | ||
| 44 | |||||
| 45 | 10 | 25µs | my $code = q{}; | ||
| 46 | |||||
| 47 | 10 | 127µs | 10 | 2.03ms | $code .= "\n" . $self->_inline_check_argument_count; # spent 1.52ms making 8 calls to Moose::Meta::Method::Accessor::Native::_inline_check_argument_count, avg 189µs/call
# spent 519µs making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_inline_check_argument_count, avg 259µs/call |
| 48 | 10 | 134µs | 10 | 97µs | $code .= "\n" . $self->_inline_process_arguments( $inv, $slot_access ); # spent 72µs making 8 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_process_arguments, avg 9µs/call
# spent 25µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_inline_process_arguments, avg 12µs/call |
| 49 | 10 | 127µs | 10 | 225µs | $code .= "\n" . $self->_inline_check_arguments('for writer'); # spent 157µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_inline_check_arguments, avg 79µs/call
# spent 68µs making 8 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_check_arguments, avg 8µs/call |
| 50 | |||||
| 51 | 10 | 227µs | 10 | 730µs | $code .= "\n" . $self->_inline_check_lazy($inv); # spent 730µs making 10 calls to Moose::Meta::Method::Accessor::_inline_check_lazy, avg 73µs/call |
| 52 | |||||
| 53 | 10 | 133µs | 10 | 149µs | my $potential_value = $self->_potential_value($slot_access); # spent 32µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_potential_value, avg 16µs/call
# spent 21µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::push::_potential_value
# spent 18µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::inc::_potential_value
# spent 18µs making 1 call to Moose::Meta::Method::Accessor::Native::String::append::_potential_value
# spent 17µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::dec::_potential_value
# spent 15µs making 1 call to Moose::Meta::Method::Accessor::Native::String::clear::_potential_value
# spent 10µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::clear::_potential_value
# spent 10µs making 1 call to Moose::Meta::Method::Accessor::Native::Bool::set::_potential_value
# spent 9µs making 1 call to Moose::Meta::Method::Accessor::Native::Bool::unset::_potential_value |
| 54 | |||||
| 55 | 10 | 131µs | 10 | 190µs | if ( $self->_return_value($slot_access) ) { # spent 128µs making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_return_value, avg 21µs/call
# spent 35µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_return_value, avg 18µs/call
# spent 17µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::push::_return_value
# spent 10µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::clear::_return_value |
| 56 | # some writers will save the return value in this variable when they | ||||
| 57 | # generate the potential value. | ||||
| 58 | $code .= "\n" . 'my @return;'; | ||||
| 59 | } | ||||
| 60 | |||||
| 61 | # This is only needed by collections. | ||||
| 62 | 10 | 130µs | 10 | 531µs | $code .= "\n" . $self->_inline_coerce_new_values; # spent 249µs making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_inline_coerce_new_values, avg 124µs/call
# spent 121µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::17::_inline_coerce_new_values
# spent 109µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::18::_inline_coerce_new_values
# spent 53µs making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_coerce_new_values, avg 9µs/call |
| 63 | 10 | 230µs | 10 | 7.26ms | $code .= "\n" . $self->_inline_copy_native_value( \$potential_value ); # spent 7.26ms making 10 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_copy_native_value, avg 726µs/call |
| 64 | 10 | 210µs | 10 | 6.30ms | $code .= "\n" # spent 2.42ms making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_tc_code, avg 404µs/call
# spent 2.07ms making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_inline_tc_code, avg 1.04ms/call
# spent 974µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::18::_inline_tc_code
# spent 836µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::17::_inline_tc_code |
| 65 | . $self->_inline_tc_code( | ||||
| 66 | $potential_value | ||||
| 67 | ); | ||||
| 68 | |||||
| 69 | 10 | 273µs | 10 | 1.04ms | $code .= "\n" . $self->_inline_get_old_value_for_trigger($inv); # spent 514µs making 6 calls to Moose::Meta::Method::Accessor::_inline_get_old_value_for_trigger, avg 86µs/call
# spent 319µs making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_inline_get_old_value_for_trigger, avg 159µs/call
# spent 107µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::17::_inline_get_old_value_for_trigger
# spent 105µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::18::_inline_get_old_value_for_trigger |
| 70 | 10 | 140µs | 10 | 100µs | $code .= "\n" . $self->_inline_capture_return_value($slot_access); # spent 100µs making 10 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_capture_return_value, avg 10µs/call |
| 71 | 10 | 159µs | 10 | 9.66ms | $code .= "\n" # spent 9.66ms making 10 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value, avg 966µs/call |
| 72 | . $self->_inline_set_new_value( | ||||
| 73 | $inv, | ||||
| 74 | $potential_value, | ||||
| 75 | $slot_access, | ||||
| 76 | ) . ';'; | ||||
| 77 | 10 | 335µs | 10 | 764µs | $code .= "\n" . $self->_inline_trigger( $inv, $slot_access, '@old' ); # spent 764µs making 10 calls to Moose::Meta::Method::Accessor::_inline_trigger, avg 76µs/call |
| 78 | 10 | 144µs | 10 | 146µs | $code .= "\n" . $self->_return_value( $slot_access, 'for writer' ); # spent 89µs making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_return_value, avg 15µs/call
# spent 32µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_return_value, avg 16µs/call
# spent 16µ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 |
| 79 | |||||
| 80 | 10 | 195µs | return $code; | ||
| 81 | } | ||||
| 82 | |||||
| 83 | 8 | 106µs | # spent 72µs within Moose::Meta::Method::Accessor::Native::Writer::_inline_process_arguments which was called 8 times, avg 9µs/call:
# 8 times (72µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 48, avg 9µs/call | ||
| 84 | |||||
| 85 | 8 | 99µs | # spent 68µs within Moose::Meta::Method::Accessor::Native::Writer::_inline_check_arguments which was called 8 times, avg 8µs/call:
# 8 times (68µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 49, avg 8µs/call | ||
| 86 | |||||
| 87 | 6 | 76µs | # spent 53µs within Moose::Meta::Method::Accessor::Native::Writer::_inline_coerce_new_values which was called 6 times, avg 9µs/call:
# 6 times (53µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 62, avg 9µs/call | ||
| 88 | |||||
| 89 | # spent 5.14ms (261µs+4.88) within Moose::Meta::Method::Accessor::Native::Writer::_value_needs_copy which was called 12 times, avg 428µs/call:
# 6 times (130µs+2.58ms) by Moose::Meta::Method::Accessor::Native::Writer::_inline_copy_native_value at line 116, avg 452µs/call
# 6 times (130µs+2.30ms) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 161, avg 405µs/call | ||||
| 90 | 12 | 34µs | my $self = shift; | ||
| 91 | |||||
| 92 | 12 | 232µs | 12 | 4.88ms | return $self->_constraint_must_be_checked; # spent 4.88ms making 12 calls to Moose::Meta::Method::Accessor::Native::Writer::_constraint_must_be_checked, avg 407µs/call |
| 93 | } | ||||
| 94 | |||||
| 95 | # spent 11.4ms (2.55+8.89) within Moose::Meta::Method::Accessor::Native::Writer::_constraint_must_be_checked which was called 30 times, avg 381µs/call:
# 12 times (1.22ms+3.66ms) by Moose::Meta::Method::Accessor::Native::Writer::_value_needs_copy at line 92, avg 407µs/call
# 8 times (589µs+2.44ms) by Class::MOP::Class:::around at line 57 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 379µs/call
# 6 times (467µs+1.78ms) by Moose::Meta::Method::Accessor::Native::Writer::_inline_tc_code at line 128, avg 374µs/call
# 4 times (271µs+1.01ms) by Class::MOP::Class:::around at line 65 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 320µs/call | ||||
| 96 | 30 | 83µs | my $self = shift; | ||
| 97 | |||||
| 98 | 30 | 306µs | 30 | 338µs | my $attr = $self->associated_attribute; # spent 338µs making 30 calls to Class::MOP::Method::Accessor::associated_attribute, avg 11µs/call |
| 99 | |||||
| 100 | 30 | 1.74ms | 108 | 8.55ms | return $attr->has_type_constraint # spent 7.50ms making 30 calls to Moose::Meta::Method::Accessor::Native::Writer::_is_root_type, avg 250µs/call
# spent 423µs making 30 calls to Moose::Meta::Mixin::AttributeCore::type_constraint, avg 14µs/call
# spent 376µs making 30 calls to Moose::Meta::Mixin::AttributeCore::has_type_constraint, avg 13µs/call
# spent 245µs making 18 calls to Moose::Meta::Mixin::AttributeCore::should_coerce, avg 14µs/call |
| 101 | && ( !$self->_is_root_type( $attr->type_constraint ) | ||||
| 102 | || ( $attr->should_coerce && $attr->type_constraint->has_coercion ) ); | ||||
| 103 | } | ||||
| 104 | |||||
| 105 | # spent 8.61ms (2.79+5.82) within Moose::Meta::Method::Accessor::Native::Writer::_is_root_type which was called 42 times, avg 205µs/call:
# 30 times (2.10ms+5.41ms) by Moose::Meta::Method::Accessor::Native::Writer::_constraint_must_be_checked at line 100, avg 250µs/call
# 12 times (692µs+410µs) by Moose::Meta::Method::Accessor::Native::Collection::_check_new_members_only at line 96 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 92µs/call | ||||
| 106 | 42 | 145µs | my ($self, $type) = @_; | ||
| 107 | |||||
| 108 | 42 | 751µs | 42 | 4.74ms | my $name = $type->name(); # spent 4.60ms making 30 calls to MooseX::Types::TypeDecorator::AUTOLOAD, avg 153µs/call
# spent 147µs making 12 calls to Moose::Meta::TypeConstraint::name, avg 12µs/call |
| 109 | |||||
| 110 | 90 | 2.31ms | 84 | 1.07ms | return any { $name eq $_ } @{ $self->root_types }; # spent 629µs making 42 calls to List::MoreUtils::any, avg 15µs/call
# spent 445µs making 42 calls to Moose::Meta::Method::Accessor::Native::root_types, avg 11µs/call |
| 111 | } | ||||
| 112 | |||||
| 113 | # spent 7.26ms (284µs+6.98) within Moose::Meta::Method::Accessor::Native::Writer::_inline_copy_native_value which was called 10 times, avg 726µs/call:
# 10 times (284µs+6.98ms) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 63, avg 726µs/call | ||||
| 114 | 10 | 34µs | my ( $self, $potential_ref ) = @_; | ||
| 115 | |||||
| 116 | 10 | 228µs | 10 | 6.98ms | return q{} unless $self->_value_needs_copy; # spent 2.71ms making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_value_needs_copy, avg 452µs/call
# spent 2.44ms making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_value_needs_copy, avg 1.22ms/call
# spent 952µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::18::_value_needs_copy
# spent 871µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::17::_value_needs_copy |
| 117 | |||||
| 118 | my $code = "my \$potential = ${$potential_ref};"; | ||||
| 119 | |||||
| 120 | ${$potential_ref} = '$potential'; | ||||
| 121 | |||||
| 122 | return $code; | ||||
| 123 | } | ||||
| 124 | |||||
| 125 | # spent 2.42ms (176µs+2.25) within Moose::Meta::Method::Accessor::Native::Writer::_inline_tc_code which was called 6 times, avg 404µs/call:
# 6 times (176µs+2.25ms) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 64, avg 404µs/call | ||||
| 126 | 6 | 27µs | my ( $self, $potential_value ) = @_; | ||
| 127 | |||||
| 128 | 6 | 156µs | 6 | 2.25ms | return q{} unless $self->_constraint_must_be_checked; # spent 2.25ms making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_constraint_must_be_checked, avg 374µs/call |
| 129 | |||||
| 130 | return $self->_inline_check_coercion($potential_value) . "\n" | ||||
| 131 | . $self->_inline_check_constraint($potential_value); | ||||
| 132 | } | ||||
| 133 | |||||
| 134 | sub _inline_check_coercion { | ||||
| 135 | my ( $self, $value ) = @_; | ||||
| 136 | |||||
| 137 | my $attr = $self->associated_attribute; | ||||
| 138 | |||||
| 139 | return q{} | ||||
| 140 | unless $attr->should_coerce | ||||
| 141 | && $attr->type_constraint->has_coercion; | ||||
| 142 | |||||
| 143 | # We want to break the aliasing in @_ in case the coercion tries to make a | ||||
| 144 | # destructive change to an array member. | ||||
| 145 | return "$value = \$type_constraint_obj->coerce($value);"; | ||||
| 146 | } | ||||
| 147 | |||||
| 148 | override _inline_check_constraint => sub { | ||||
| 149 | my ( $self, $value, $for_lazy ) = @_; | ||||
| 150 | |||||
| 151 | return q{} unless $for_lazy || $self->_constraint_must_be_checked; | ||||
| 152 | |||||
| 153 | return super(); | ||||
| 154 | 1 | 21µs | 1 | 515µs | }; # spent 515µs making 1 call to Moose::Role::override |
| 155 | |||||
| 156 | 10 | 143µs | # spent 100µs within Moose::Meta::Method::Accessor::Native::Writer::_inline_capture_return_value which was called 10 times, avg 10µs/call:
# 10 times (100µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 70, avg 10µs/call | ||
| 157 | |||||
| 158 | # spent 9.66ms (965µs+8.70) within Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value which was called 10 times, avg 966µs/call:
# 10 times (965µs+8.70ms) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 71, avg 966µs/call | ||||
| 159 | 10 | 95µs | my $self = shift; | ||
| 160 | |||||
| 161 | 10 | 404µs | 30 | 8.39ms | return $self->_inline_store(@_) # spent 2.43ms making 6 calls to Moose::Meta::Method::Accessor::Native::Writer::_value_needs_copy, avg 405µs/call
# spent 1.63ms making 2 calls to Class::MOP::Class::__ANON__::SERIAL::7::_value_needs_copy, avg 815µs/call
# spent 1.61ms making 10 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 161µs/call
# spent 1.03ms making 10 calls to Moose::Meta::Method::Accessor::Native::Writer::_inline_get_is_lvalue, avg 103µs/call
# spent 859µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::18::_value_needs_copy
# spent 819µs making 1 call to Class::MOP::Class::__ANON__::SERIAL::17::_value_needs_copy |
| 162 | if $self->_value_needs_copy | ||||
| 163 | || !$self->_slot_access_can_be_inlined | ||||
| 164 | || !$self->_inline_get_is_lvalue; | ||||
| 165 | |||||
| 166 | 10 | 270µs | 10 | 313µs | return $self->_inline_optimized_set_new_value(@_); # spent 110µs making 1 call to Moose::Meta::Method::Accessor::Native::Bool::set::_inline_optimized_set_new_value
# spent 42µs making 2 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_inline_optimized_set_new_value, avg 21µs/call
# spent 31µs making 1 call to Moose::Meta::Method::Accessor::Native::String::clear::_inline_optimized_set_new_value
# spent 24µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::push::_inline_optimized_set_new_value
# spent 23µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::clear::_inline_optimized_set_new_value
# spent 22µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::inc::_inline_optimized_set_new_value
# spent 21µs making 1 call to Moose::Meta::Method::Accessor::Native::String::append::_inline_optimized_set_new_value
# spent 21µs making 1 call to Moose::Meta::Method::Accessor::Native::Counter::dec::_inline_optimized_set_new_value
# spent 20µs making 1 call to Moose::Meta::Method::Accessor::Native::Bool::unset::_inline_optimized_set_new_value |
| 167 | } | ||||
| 168 | |||||
| 169 | # spent 1.03ms (661µs+372µs) within Moose::Meta::Method::Accessor::Native::Writer::_inline_get_is_lvalue which was called 10 times, avg 103µs/call:
# 10 times (661µs+372µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 161, avg 103µs/call | ||||
| 170 | 10 | 29µs | my $self = shift; | ||
| 171 | |||||
| 172 | 10 | 482µs | 40 | 372µs | return $self->associated_attribute->associated_class->instance_metaclass->inline_get_is_lvalue; # spent 106µs making 10 calls to Class::MOP::Class::instance_metaclass, avg 11µs/call
# spent 91µs making 10 calls to Class::MOP::Instance::inline_get_is_lvalue, avg 9µs/call
# spent 90µs making 10 calls to Class::MOP::Attribute::associated_class, avg 9µs/call
# spent 84µs making 10 calls to Class::MOP::Method::Accessor::associated_attribute, avg 8µs/call |
| 173 | } | ||||
| 174 | |||||
| 175 | sub _inline_optimized_set_new_value { | ||||
| 176 | my $self = shift; | ||||
| 177 | |||||
| 178 | return $self->_inline_store(@_); | ||||
| 179 | } | ||||
| 180 | |||||
| 181 | # spent 218µs within Moose::Meta::Method::Accessor::Native::Writer::_return_value which was called 12 times, avg 18µs/call:
# 6 times (128µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 55, avg 21µs/call
# 6 times (89µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_writer_core at line 78, avg 15µs/call | ||||
| 182 | 12 | 95µs | my ( $self, $slot_access ) = @_; | ||
| 183 | |||||
| 184 | 12 | 178µs | return $slot_access; | ||
| 185 | } | ||||
| 186 | |||||
| 187 | 3 | 124µs | 2 | 1.59ms | # spent 822µs (50+773) within Moose::Meta::Method::Accessor::Native::Writer::BEGIN@187 which was called:
# once (50µs+773µs) by Class::MOP::__ANON__[/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Class/MOP.pm:118] at line 187 # spent 822µs making 1 call to Moose::Meta::Method::Accessor::Native::Writer::BEGIN@187
# spent 773µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557] |
| 188 | |||||
| 189 | 1 | 62µs | 1; |