← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 22:00:36 2010
Reported on Wed Nov 17 22:14:22 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm
StatementsExecuted 576 statements in 24.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
141111.5ms11.5msMoose::Meta::Method::Accessor::Native::::_newMoose::Meta::Method::Accessor::Native::_new
14331.82ms2.45msMoose::Meta::Method::Accessor::Native::::_inline_check_argument_countMoose::Meta::Method::Accessor::Native::_inline_check_argument_count
38321.73ms5.54msMoose::Meta::Method::Accessor::Native::::_slot_access_can_be_inlinedMoose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined
14111.21ms72.1msMoose::Meta::Method::Accessor::Native::::_initialize_bodyMoose::Meta::Method::Accessor::Native::_initialize_body
1411843µs6.96msMoose::Meta::Method::Accessor::Native::::__ANON__[:145]Moose::Meta::Method::Accessor::Native::__ANON__[:145]
1422715µs864µsMoose::Meta::Method::Accessor::Native::::_inline_curried_argumentsMoose::Meta::Method::Accessor::Native::_inline_curried_arguments
1422594µs813µsMoose::Meta::Method::Accessor::Native::::_inline_return_valueMoose::Meta::Method::Accessor::Native::_inline_return_value
1411539µs5.68msMoose::Meta::Method::Accessor::Native::::__ANON__[:114]Moose::Meta::Method::Accessor::Native::__ANON__[:114]
3011292µs292µsMoose::Meta::Method::Accessor::Native::::root_typesMoose::Meta::Method::Accessor::Native::root_types
11175µs94µsMoose::Meta::Method::Accessor::Native::::BEGIN@3Moose::Meta::Method::Accessor::Native::BEGIN@3
71155µs55µsMoose::Meta::Method::Accessor::Native::::_minimum_argumentsMoose::Meta::Method::Accessor::Native::_minimum_arguments
11150µs732µsMoose::Meta::Method::Accessor::Native::::BEGIN@153Moose::Meta::Method::Accessor::Native::BEGIN@153
11145µs13.5msMoose::Meta::Method::Accessor::Native::::BEGIN@13Moose::Meta::Method::Accessor::Native::BEGIN@13
11140µs108µsMoose::Meta::Method::Accessor::Native::::BEGIN@4Moose::Meta::Method::Accessor::Native::BEGIN@4
11139µs201µsMoose::Meta::Method::Accessor::Native::::BEGIN@6Moose::Meta::Method::Accessor::Native::BEGIN@6
11139µs216µsMoose::Meta::Method::Accessor::Native::::BEGIN@7Moose::Meta::Method::Accessor::Native::BEGIN@7
31123µs23µsMoose::Meta::Method::Accessor::Native::::_maximum_argumentsMoose::Meta::Method::Accessor::Native::_maximum_arguments
0000s0sMoose::Meta::Method::Accessor::Native::::__ANON__[:123]Moose::Meta::Method::Accessor::Native::__ANON__[:123]
0000s0sMoose::Meta::Method::Accessor::Native::::__ANON__[:32]Moose::Meta::Method::Accessor::Native::__ANON__[:32]
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;
2
33103µs2112µ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
use strict;
# spent 94µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@3 # spent 18µs making 1 call to strict::import
43108µs2175µ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
use warnings;
# spent 108µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@4 # spent 68µs making 1 call to warnings::import
5
63110µs2363µ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
use Carp qw( confess );
# spent 201µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@6 # spent 162µs making 1 call to Exporter::import
73222µs2393µ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
use Scalar::Util qw( blessed weaken );
# spent 216µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@7 # spent 177µs making 1 call to Exporter::import
8
914µsour $VERSION = '1.19';
10178µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1114µsour $AUTHORITY = 'cpan:STEVAN';
12
1332.39ms226.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
use Moose::Role;
# 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
15around new => sub {
161457µs my $orig = shift;
171452µs my $class = shift;
1814219µs my %options = @_;
19
201444µs $options{curried_arguments} = []
21 unless exists $options{curried_arguments};
22
231486µ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
2714370µs14105µ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
291459µs $options{accessor_type} = 'native';
30
3114521µs1485.6ms return $class->$orig(%options);
# spent 85.6ms making 14 calls to Class::MOP::Method::Accessor::new, avg 6.11ms/call
32123µs1414µ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
sub _new {
351454µs my $class = shift;
361456µs my $options = @_ == 1 ? $_[0] : {@_};
37
381411.5ms return bless $options, $class;
39}
40
4130399µ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
sub root_types { (shift)->{'root_types'} }
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
sub _initialize_body {
441442µs my $self = shift;
45
4614948µs2870.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
4814192µ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
sub _inline_curried_arguments {
521443µs my $self = shift;
53
5414646µs14150µ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
sub _inline_check_argument_count {
601435µs my $self = shift;
61
621426µs my @code;
63
6414461µs24256µ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
7914783µs32373µs if (defined(my $max = $self->_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
9414242µ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
sub _inline_return_value {
981445µs my $self = shift;
991459µs my ($slot_access, $for_writer) = @_;
100
10114348µs14218µs return 'return ' . $self->_return_value($slot_access, $for_writer) . ';';
102}
103
104796µ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
sub _minimum_arguments { 0 }
105355µ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
sub _maximum_arguments { undef }
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
override _get_value => sub {
1081440µs my $self = shift;
1091448µs my ($instance) = @_;
110
11114502µs285.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';
114119µs1444µs};
# spent 444µs making 1 call to Moose::Role::override
115
116override _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 . ');';
123119µs1284µ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
override _eval_environment => sub {
1261442µs my $self = shift;
127
12814164µs144.15ms my $env = super();
# spent 4.15ms making 14 calls to Moose::Role::super, avg 296µs/call
129
13014287µs14232µs $env->{'@curried'} = $self->curried_arguments;
# spent 232µs making 14 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 17µs/call
131
13214445µs141.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;
145120µs1275µ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
sub _slot_access_can_be_inlined {
14838107µs my $self = shift;
149
150381.81ms763.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
1533128µs21.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
no Moose::Role;
# 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
155153µs1;