← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:11 2016

Filename/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native.pm
StatementsExecuted 2147 statements in 6.16ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
50336.15ms6.47msMoose::Meta::Method::Accessor::Native::::_inline_check_argument_countMoose::Meta::Method::Accessor::Native::_inline_check_argument_count
5011915µs55.9msMoose::Meta::Method::Accessor::Native::::_initialize_bodyMoose::Meta::Method::Accessor::Native::_initialize_body
10732618µs1.95msMoose::Meta::Method::Accessor::Native::::_slot_access_can_be_inlinedMoose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined
5011491µs11.9msMoose::Meta::Method::Accessor::Native::::__ANON__[:147]Moose::Meta::Method::Accessor::Native::__ANON__[:147]
5011331µs2.79msMoose::Meta::Method::Accessor::Native::::__ANON__[:116]Moose::Meta::Method::Accessor::Native::__ANON__[:116]
5022276µs426µsMoose::Meta::Method::Accessor::Native::::_inline_return_valueMoose::Meta::Method::Accessor::Native::_inline_return_value
5022264µs342µsMoose::Meta::Method::Accessor::Native::::_inline_curried_argumentsMoose::Meta::Method::Accessor::Native::_inline_curried_arguments
5011190µs190µsMoose::Meta::Method::Accessor::Native::::_newMoose::Meta::Method::Accessor::Native::_new
391145µs45µsMoose::Meta::Method::Accessor::Native::::_minimum_argumentsMoose::Meta::Method::Accessor::Native::_minimum_arguments
171122µs22µsMoose::Meta::Method::Accessor::Native::::root_typesMoose::Meta::Method::Accessor::Native::root_types
11110µs22µsMoose::Meta::Method::Accessor::Native::::BEGIN@4Moose::Meta::Method::Accessor::Native::BEGIN@4
1119µs27µsMoose::Meta::Method::Accessor::Native::::BEGIN@8Moose::Meta::Method::Accessor::Native::BEGIN@8
1118µs107µsMoose::Meta::Method::Accessor::Native::::BEGIN@12Moose::Meta::Method::Accessor::Native::BEGIN@12
7117µs7µsMoose::Meta::Method::Accessor::Native::::_maximum_argumentsMoose::Meta::Method::Accessor::Native::_maximum_arguments
1117µs80µsMoose::Meta::Method::Accessor::Native::::BEGIN@155Moose::Meta::Method::Accessor::Native::BEGIN@155
1117µs11µsMoose::Meta::Method::Accessor::Native::::BEGIN@5Moose::Meta::Method::Accessor::Native::BEGIN@5
1117µs42µsMoose::Meta::Method::Accessor::Native::::BEGIN@7Moose::Meta::Method::Accessor::Native::BEGIN@7
1116µs2.04msMoose::Meta::Method::Accessor::Native::::BEGIN@10Moose::Meta::Method::Accessor::Native::BEGIN@10
0000s0sMoose::Meta::Method::Accessor::Native::::__ANON__[:125]Moose::Meta::Method::Accessor::Native::__ANON__[:125]
0000s0sMoose::Meta::Method::Accessor::Native::::__ANON__[:42]Moose::Meta::Method::Accessor::Native::__ANON__[:42]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Meta::Method::Accessor::Native;
21300nsour $VERSION = '2.1604';
3
4221µs234µs
# spent 22µs (10+12) within Moose::Meta::Method::Accessor::Native::BEGIN@4 which was called: # once (10µs+12µs) by Module::Runtime::require_module at line 4
use strict;
# spent 22µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@4 # spent 12µs making 1 call to strict::import
5225µs216µs
# spent 11µs (7+4) within Moose::Meta::Method::Accessor::Native::BEGIN@5 which was called: # once (7µs+4µs) by Module::Runtime::require_module at line 5
use warnings;
# spent 11µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@5 # spent 4µs making 1 call to warnings::import
6
7223µs276µs
# spent 42µs (7+35) within Moose::Meta::Method::Accessor::Native::BEGIN@7 which was called: # once (7µs+35µs) by Module::Runtime::require_module at line 7
use Carp qw( confess );
# spent 42µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@7 # spent 35µs making 1 call to Exporter::import
8225µs245µs
# spent 27µs (9+18) within Moose::Meta::Method::Accessor::Native::BEGIN@8 which was called: # once (9µs+18µs) by Module::Runtime::require_module at line 8
use Scalar::Util qw( blessed );
# spent 27µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@8 # spent 18µs making 1 call to Exporter::import
9
10242µs24.07ms
# spent 2.04ms (6µs+2.03) within Moose::Meta::Method::Accessor::Native::BEGIN@10 which was called: # once (6µs+2.03ms) by Module::Runtime::require_module at line 10
use Moose::Role;
# spent 2.04ms making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@10 # spent 2.03ms making 1 call to Moose::Role::import
11
122589µs2205µs
# spent 107µs (8+99) within Moose::Meta::Method::Accessor::Native::BEGIN@12 which was called: # once (8µs+99µs) by Module::Runtime::require_module at line 12
use Moose::Util 'throw_exception';
# spent 107µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@12 # spent 99µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
13
14around new => sub {
155018µs my $orig = shift;
165019µs my $class = shift;
1750146µs my %options = @_;
18
195036µs $options{curried_arguments} = []
20 unless exists $options{curried_arguments};
21
225065µs throw_exception( MustSupplyArrayRefAsCurriedArguments => params => \%options,
23 class_name => $class
24 )
25 unless $options{curried_arguments}
26 && ref($options{curried_arguments}) eq 'ARRAY';
27
2850183µs5043µs my $attr_context = $options{attribute}->definition_context;
# spent 43µs making 50 calls to Class::MOP::Mixin::AttributeCore::definition_context, avg 858ns/call
295016µs my $desc = 'native delegation method ';
3050206µs10034µs $desc .= $options{attribute}->associated_class->name;
# spent 17µs making 50 calls to Class::MOP::Attribute::associated_class, avg 348ns/call # spent 16µs making 50 calls to Class::MOP::Package::name, avg 324ns/call
315040µs $desc .= '::' . $options{name};
325040µs $desc .= " ($options{delegate_to_method})";
3350163µs5024µs $desc .= " of attribute " . $options{attribute}->name;
# spent 24µs making 50 calls to Class::MOP::Mixin::AttributeCore::name, avg 482ns/call
34 $options{definition_context} = {
3550196µs %{ $attr_context || {} },
36 description => $desc,
37 };
38
395035µs $options{accessor_type} = 'native';
40
4150331µs50108µs return $class->$orig(%options);
# spent 108µs making 50 calls to Moose::Meta::Method::Accessor::new, avg 2µs/call
42113µs171µs};
# spent 71µs making 1 call to Moose::Role::around
43
44
# spent 190µs within Moose::Meta::Method::Accessor::Native::_new which was called 50 times, avg 4µs/call: # 50 times (190µs+0s) by Class::MOP::Method::Accessor::new at line 36 of Class/MOP/Method/Accessor.pm, avg 4µs/call
sub _new {
455022µs my $class = shift;
465042µs my $options = @_ == 1 ? $_[0] : {@_};
47
4850174µs return bless $options, $class;
49}
50
511738µs
# spent 22µs within Moose::Meta::Method::Accessor::Native::root_types which was called 17 times, avg 1µs/call: # 17 times (22µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_is_root_type at line 103 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 1µs/call
sub root_types { (shift)->{'root_types'} }
52
53
# spent 55.9ms (915µs+55.0) within Moose::Meta::Method::Accessor::Native::_initialize_body which was called 50 times, avg 1.12ms/call: # 50 times (915µs+55.0ms) by Class::MOP::Method::Accessor::new at line 43 of Class/MOP/Method/Accessor.pm, avg 1.12ms/call
sub _initialize_body {
545022µs my $self = shift;
55
5650722µs10055.0ms $self->{'body'} = $self->_compile_code( [$self->_generate_method] );
# spent 33.3ms making 50 calls to Moose::Meta::Method::Accessor::_compile_code, avg 667µs/call # spent 16.3ms making 43 calls to Moose::Meta::Method::Accessor::Native::Reader::_generate_method, avg 380µs/call # spent 5.29ms making 7 calls to Moose::Meta::Method::Accessor::Native::Writer::_generate_method, avg 755µs/call
57
5850129µs return;
59}
60
61
# spent 342µs (264+77) within Moose::Meta::Method::Accessor::Native::_inline_curried_arguments which was called 50 times, avg 7µs/call: # 43 times (227µs+66µs) by Moose::Meta::Method::Accessor::Native::Reader::_generate_method at line 20 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 7µs/call # 7 times (38µs+11µs) by Moose::Meta::Method::Accessor::Native::Writer::_generate_method at line 23 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 7µs/call
sub _inline_curried_arguments {
625017µs my $self = shift;
63
6450235µs5078µs return unless @{ $self->curried_arguments };
# spent 78µs making 50 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 2µs/call
65
66 return 'unshift @_, @curried;';
67}
68
69
# spent 6.47ms (6.15+327µs) within Moose::Meta::Method::Accessor::Native::_inline_check_argument_count which was called 50 times, avg 129µs/call: # 43 times (6.05ms+299µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 33 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 148µs/call # 4 times (36µs+7µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 39 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 11µs/call # 3 times (60µs+21µs) by Class::MOP::Class:::around at line 21 of Moose/Meta/Method/Accessor/Native/Hash/set.pm, avg 27µs/call
sub _inline_check_argument_count {
705015µs my $self = shift;
71
725014µs my @code;
73
7450212µs72116µs if (my $min = $self->_minimum_arguments) {
# spent 45µs making 39 calls to Moose::Meta::Method::Accessor::Native::_minimum_arguments, avg 1µs/call # spent 32µs making 11 calls to Class::MOP::Method::Accessor::_inline_throw_exception, avg 3µs/call # spent 22µs making 11 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 2µs/call # spent 5µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::get::_minimum_arguments, avg 2µs/call # spent 4µs making 2 calls to Moose::Meta::Method::Accessor::Native::Array::get::_minimum_arguments, avg 2µs/call # spent 4µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::exists::_minimum_arguments, avg 1µs/call # spent 4µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_minimum_arguments, avg 1µs/call
75 push @code, (
76 'if (@_ < ' . $min . ') {',
77 $self->_inline_throw_exception( MethodExpectsMoreArgs =>
78 'method_name => "'.$self->delegate_to_method.'",'.
79 "minimum_args => ".$min,
80 ) . ';',
81 '}',
82 );
83 }
84
8550358µs130211µs if (defined(my $max = $self->_maximum_arguments)) {
# spent 79µs making 40 calls to Class::MOP::Method::Accessor::_inline_throw_exception, avg 2µs/call # spent 58µs making 40 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 1µs/call # spent 26µs making 21 calls to Moose::Meta::Method::Accessor::Native::Hash::count::_maximum_arguments, avg 1µs/call # spent 19µs making 11 calls to Moose::Meta::Method::Accessor::Native::Array::count::_maximum_arguments, avg 2µs/call # spent 7µs making 7 calls to Moose::Meta::Method::Accessor::Native::_maximum_arguments, avg 1µs/call # spent 6µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::keys::_maximum_arguments, avg 2µs/call # spent 6µs making 2 calls to Moose::Meta::Method::Accessor::Native::Array::get::_maximum_arguments, avg 3µs/call # spent 5µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::exists::_maximum_arguments, avg 2µs/call # spent 4µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_maximum_arguments, avg 1µs/call
86 push @code, (
87 'if (@_ > ' . $max . ') {',
88 $self->_inline_throw_exception( MethodExpectsFewerArgs =>
89 'method_name => "'.$self->delegate_to_method.'",'.
90 'maximum_args => '.$max,
91 ) . ';',
92 '}',
93 );
94 }
95
9650163µs return @code;
97}
98
99
# spent 426µs (276+150) within Moose::Meta::Method::Accessor::Native::_inline_return_value which was called 50 times, avg 9µs/call: # 43 times (237µs+137µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 33 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 9µs/call # 7 times (40µs+12µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 52 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 7µs/call
sub _inline_return_value {
1005016µs my $self = shift;
1015024µs my ($slot_access, $for_writer) = @_;
102
10350222µs50150µs return 'return ' . $self->_return_value($slot_access, $for_writer) . ';';
# spent 55µs making 21 calls to Moose::Meta::Method::Accessor::Native::Hash::count::_return_value, avg 3µs/call # spent 41µs making 11 calls to Moose::Meta::Method::Accessor::Native::Array::count::_return_value, avg 4µs/call # spent 12µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::keys::_return_value, avg 4µs/call # spent 12µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::exists::_return_value, avg 4µs/call # spent 11µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::get::_return_value, avg 4µs/call # spent 7µs making 3 calls to Moose::Meta::Method::Accessor::Native::Hash::set::_return_value, avg 2µs/call # spent 6µs making 2 calls to Moose::Meta::Method::Accessor::Native::Array::get::_return_value, avg 3µs/call # spent 6µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::push::_return_value, avg 1µs/call
104}
105
1063979µs
# spent 45µs within Moose::Meta::Method::Accessor::Native::_minimum_arguments which was called 39 times, avg 1µs/call: # 39 times (45µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 74, avg 1µs/call
sub _minimum_arguments { 0 }
107716µs
# spent 7µs within Moose::Meta::Method::Accessor::Native::_maximum_arguments which was called 7 times, avg 1µs/call: # 7 times (7µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 85, avg 1µs/call
sub _maximum_arguments { undef }
108
109
# spent 2.79ms (331µs+2.46) within Moose::Meta::Method::Accessor::Native::__ANON__[/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native.pm:116] which was called 50 times, avg 56µs/call: # 50 times (331µs+2.46ms) by Moose::Meta::Class::__ANON__::SERIAL::10::_get_value or 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::8::_get_value or Moose::Meta::Class::__ANON__::SERIAL::9::_get_value at line 38 of Moose/Meta/Method/Overridden.pm, avg 56µs/call
override _get_value => sub {
1105019µs my $self = shift;
1115015µs my ($instance) = @_;
112
11350269µs1002.46ms return $self->_slot_access_can_be_inlined
# spent 1.41ms making 50 calls to Moose::Role::super, avg 28µs/call # spent 1.05ms making 50 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 21µs/call
114 ? super()
115 : $instance . '->$reader';
11612µs164µs};
# spent 64µs making 1 call to Moose::Role::override
117
118override _inline_store_value => sub {
119 my $self = shift;
120 my ($instance, $value) = @_;
121
122 return $self->_slot_access_can_be_inlined
123 ? super()
124 : $instance . '->$writer(' . $value . ');';
12512µs131µs};
# spent 31µs making 1 call to Moose::Role::override
126
127
# spent 11.9ms (491µs+11.4) within Moose::Meta::Method::Accessor::Native::__ANON__[/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native.pm:147] which was called 50 times, avg 237µs/call: # 50 times (491µs+11.4ms) by Moose::Meta::Class::__ANON__::SERIAL::10::_eval_environment or 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::8::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::9::_eval_environment at line 38 of Moose/Meta/Method/Overridden.pm, avg 237µs/call
override _eval_environment => sub {
1285021µs my $self = shift;
129
1305059µs5010.5ms my $env = super();
# spent 10.5ms making 50 calls to Moose::Role::super, avg 211µs/call
131
13250100µs5056µs $env->{'@curried'} = $self->curried_arguments;
# spent 56µs making 50 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 1µs/call
133
13450190µs50782µs return $env if $self->_slot_access_can_be_inlined;
# spent 782µs making 50 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 16µs/call
135
136 my $reader = $self->associated_attribute->get_read_method_ref;
137 $reader = $reader->body if blessed $reader;
138
139 $env->{'$reader'} = \$reader;
140
141 my $writer = $self->associated_attribute->get_write_method_ref;
142 $writer = $writer->body if blessed $writer;
143
144 $env->{'$writer'} = \$writer;
145
146 return $env;
14712µs129µs};
# spent 29µs making 1 call to Moose::Role::override
148
149
# spent 1.95ms (618µs+1.33) within Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined which was called 107 times, avg 18µs/call: # 50 times (357µs+690µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native.pm:116] at line 113, avg 21µs/call # 50 times (226µs+557µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor/Native.pm:147] at line 134, avg 16µs/call # 7 times (35µs+85µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 145 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 17µs/call
sub _slot_access_can_be_inlined {
15010724µs my $self = shift;
151
152107668µs2141.33ms return $self->is_inline && $self->_instance_is_inlinable;
# spent 1.25ms making 107 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 12µs/call # spent 82µs making 107 calls to Class::MOP::Method::Generated::is_inline, avg 764ns/call
153}
154
155226µs2154µs
# spent 80µs (7+74) within Moose::Meta::Method::Accessor::Native::BEGIN@155 which was called: # once (7µs+74µs) by Module::Runtime::require_module at line 155
no Moose::Role;
# spent 80µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@155 # spent 74µs making 1 call to Moose::Role::unimport
156
15718µs1;