← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:42:38 2010
Reported on Wed Nov 17 22:06:11 2010

Filename/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm
StatementsExecuted 213 statements in 11.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
5114.69ms4.69msMoose::Meta::Method::Accessor::Native::::_newMoose::Meta::Method::Accessor::Native::_new
522558µs752µsMoose::Meta::Method::Accessor::Native::::_inline_check_argument_countMoose::Meta::Method::Accessor::Native::_inline_check_argument_count
1232542µs1.74msMoose::Meta::Method::Accessor::Native::::_slot_access_can_be_inlinedMoose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined
511441µs19.8msMoose::Meta::Method::Accessor::Native::::_initialize_bodyMoose::Meta::Method::Accessor::Native::_initialize_body
511322µs1.77msMoose::Meta::Method::Accessor::Native::::__ANON__[:145]Moose::Meta::Method::Accessor::Native::__ANON__[:145]
522309µs390µsMoose::Meta::Method::Accessor::Native::::_inline_return_valueMoose::Meta::Method::Accessor::Native::_inline_return_value
522247µs298µsMoose::Meta::Method::Accessor::Native::::_inline_curried_argumentsMoose::Meta::Method::Accessor::Native::_inline_curried_arguments
511197µs2.09msMoose::Meta::Method::Accessor::Native::::__ANON__[:114]Moose::Meta::Method::Accessor::Native::__ANON__[:114]
111109µs127µsMoose::Meta::Method::Accessor::Native::::BEGIN@3Moose::Meta::Method::Accessor::Native::BEGIN@3
11146µs694µsMoose::Meta::Method::Accessor::Native::::BEGIN@153Moose::Meta::Method::Accessor::Native::BEGIN@153
11143µs13.3msMoose::Meta::Method::Accessor::Native::::BEGIN@13Moose::Meta::Method::Accessor::Native::BEGIN@13
11139µs106µsMoose::Meta::Method::Accessor::Native::::BEGIN@4Moose::Meta::Method::Accessor::Native::BEGIN@4
51137µs37µsMoose::Meta::Method::Accessor::Native::::_minimum_argumentsMoose::Meta::Method::Accessor::Native::_minimum_arguments
11137µs199µsMoose::Meta::Method::Accessor::Native::::BEGIN@6Moose::Meta::Method::Accessor::Native::BEGIN@6
11137µs195µsMoose::Meta::Method::Accessor::Native::::BEGIN@7Moose::Meta::Method::Accessor::Native::BEGIN@7
21121µs21µsMoose::Meta::Method::Accessor::Native::::root_typesMoose::Meta::Method::Accessor::Native::root_types
1117µs7µ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
33104µs2146µs
# spent 127µs (109+19) within Moose::Meta::Method::Accessor::Native::BEGIN@3 which was called: # once (109µs+19µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 3
use strict;
# spent 127µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@3 # spent 19µs making 1 call to strict::import
43106µs2173µs
# spent 106µs (39+67) within Moose::Meta::Method::Accessor::Native::BEGIN@4 which was called: # once (39µs+67µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 4
use warnings;
# spent 106µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@4 # spent 67µs making 1 call to warnings::import
5
63106µs2361µs
# spent 199µs (37+162) within Moose::Meta::Method::Accessor::Native::BEGIN@6 which was called: # once (37µ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 199µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@6 # spent 162µs making 1 call to Exporter::import
73230µs2352µs
# spent 195µs (37+158) within Moose::Meta::Method::Accessor::Native::BEGIN@7 which was called: # once (37µs+158µ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 195µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@7 # spent 158µs making 1 call to Exporter::import
8
914µsour $VERSION = '1.19';
10176µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1114µsour $AUTHORITY = 'cpan:STEVAN';
12
1332.38ms226.6ms
# spent 13.3ms (43µs+13.3) within Moose::Meta::Method::Accessor::Native::BEGIN@13 which was called: # once (43µs+13.3ms) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 13
use Moose::Role;
# spent 13.3ms making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@13 # spent 13.3ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:456]
14
15around new => sub {
1640491µs my $orig = shift;
17 my $class = shift;
18 my %options = @_;
19
20 $options{curried_arguments} = []
21 unless exists $options{curried_arguments};
22
23 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
27536µs $options{definition_context} = $options{attribute}->definition_context;
# spent 36µs making 5 calls to Class::MOP::Mixin::AttributeCore::definition_context, avg 7µs/call
28
29 $options{accessor_type} = 'native';
30
31525.2ms return $class->$orig(%options);
# spent 25.2ms making 5 calls to Class::MOP::Method::Accessor::new, avg 5.04ms/call
32121µs1349µs};
# spent 349µs making 1 call to Moose::Role::around
33
34
# spent 4.69ms within Moose::Meta::Method::Accessor::Native::_new which was called 5 times, avg 937µs/call: # 5 times (4.69ms+0s) by Class::MOP::Method::Accessor::new at line 33 of Class/MOP/Method/Accessor.pm, avg 937µs/call
sub _new {
35154.72ms my $class = shift;
36 my $options = @_ == 1 ? $_[0] : {@_};
37
38 return bless $options, $class;
39}
40
41232µs
# spent 21µs within Moose::Meta::Method::Accessor::Native::root_types which was called 2 times, avg 10µs/call: # 2 times (21µ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 19.8ms (441µs+19.3) within Moose::Meta::Method::Accessor::Native::_initialize_body which was called 5 times, avg 3.95ms/call: # 5 times (441µs+19.3ms) by Class::MOP::Method::Accessor::new at line 40 of Class/MOP/Method/Accessor.pm, avg 3.95ms/call
sub _initialize_body {
4415410µs my $self = shift;
45
461019.3ms $self->{'body'} = $self->_compile_code( [$self->_generate_method] );
# spent 11.3ms making 5 calls to Moose::Meta::Method::Accessor::_compile_code, avg 2.26ms/call # spent 4.84ms making 2 calls to Moose::Meta::Method::Accessor::Native::Writer::_generate_method, avg 2.42ms/call # spent 3.20ms making 3 calls to Moose::Meta::Method::Accessor::Native::Reader::_generate_method, avg 1.07ms/call
47
48 return;
49}
50
51
# spent 298µs (247+51) within Moose::Meta::Method::Accessor::Native::_inline_curried_arguments which was called 5 times, avg 60µs/call: # 3 times (151µs+31µs) by Moose::Meta::Method::Accessor::Native::Reader::_generate_method at line 23 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 61µs/call # 2 times (96µs+20µs) by Moose::Meta::Method::Accessor::Native::Writer::_generate_method at line 25 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 58µs/call
sub _inline_curried_arguments {
5210236µs my $self = shift;
53
54551µs return unless @{ $self->curried_arguments };
# spent 51µs making 5 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 10µs/call
55
56 return 'unshift @_, @curried;';
57}
58
59
# spent 752µs (558+194) within Moose::Meta::Method::Accessor::Native::_inline_check_argument_count which was called 5 times, avg 150µs/call: # 3 times (386µs+134µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 36 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 174µs/call # 2 times (172µs+59µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 41 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 116µs/call
sub _inline_check_argument_count {
6025480µs my $self = shift;
61
62 my @code;
63
64537µs if (my $min = $self->_minimum_arguments) {
# spent 37µs making 5 calls to Moose::Meta::Method::Accessor::Native::_minimum_arguments, avg 7µs/call
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
7913156µ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
94 return @code;
95}
96
97
# spent 390µs (309+81) within Moose::Meta::Method::Accessor::Native::_inline_return_value which was called 5 times, avg 78µs/call: # 3 times (241µs+58µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 36 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 100µs/call # 2 times (68µs+23µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 54 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 46µs/call
sub _inline_return_value {
9815265µs my $self = shift;
99 my ($slot_access, $for_writer) = @_;
100
101581µs return 'return ' . $self->_return_value($slot_access, $for_writer) . ';';
102}
103
104562µs
# spent 37µs within Moose::Meta::Method::Accessor::Native::_minimum_arguments which was called 5 times, avg 7µs/call: # 5 times (37µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 64, avg 7µs/call
sub _minimum_arguments { 0 }
105116µs
# spent 7µs within Moose::Meta::Method::Accessor::Native::_maximum_arguments which was called: # once (7µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 79
sub _maximum_arguments { undef }
106
107
# spent 2.09ms (197µs+1.89) within Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:114] which was called 5 times, avg 417µs/call: # 5 times (197µs+1.89ms) by Class::MOP::Class::__ANON__::SERIAL::3::_get_value or Class::MOP::Class::__ANON__::SERIAL::4::_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::8::_get_value at line 36 of Moose/Meta/Method/Overridden.pm, avg 417µs/call
override _get_value => sub {
10815208µs my $self = shift;
109 my ($instance) = @_;
110
111101.89ms return $self->_slot_access_can_be_inlined
# spent 1.01ms making 5 calls to Moose::Role::super, avg 203µs/call # spent 877µs making 5 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 175µs/call
112 ? super()
113 : $instance . '->$reader';
114118µs1443µs};
# spent 443µ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 . ');';
123118µs1357µs};
# spent 357µs making 1 call to Moose::Role::override
124
125
# spent 1.77ms (322µs+1.45) within Moose::Meta::Method::Accessor::Native::__ANON__[/home/doy/coding/src/Moose/blib/lib//Moose/Meta/Method/Accessor/Native.pm:145] which was called 5 times, avg 355µs/call: # 5 times (322µs+1.45ms) by Class::MOP::Class::__ANON__::SERIAL::3::_eval_environment or Class::MOP::Class::__ANON__::SERIAL::4::_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::8::_eval_environment at line 36 of Moose/Meta/Method/Overridden.pm, avg 355µs/call
override _eval_environment => sub {
12620273µs my $self = shift;
127
1285785µs my $env = super();
# spent 785µs making 5 calls to Moose::Role::super, avg 157µs/call
129
130554µs $env->{'@curried'} = $self->curried_arguments;
# spent 54µs making 5 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 11µs/call
131
1325613µs return $env if $self->_slot_access_can_be_inlined;
# spent 613µs making 5 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 123µ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µs1271µs};
# spent 271µs making 1 call to Moose::Role::override
146
147
# spent 1.74ms (542µs+1.20) within Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined which was called 12 times, avg 145µs/call: # 5 times (313µs+564µs) 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 175µs/call # 5 times (162µs+451µs) 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 123µs/call # 2 times (67µs+187µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 150 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 127µs/call
sub _slot_access_can_be_inlined {
14824625µs my $self = shift;
149
150241.20ms return $self->is_inline && $self->_instance_is_inlinable;
# spent 1.12ms making 12 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 94µs/call # spent 77µs making 12 calls to Class::MOP::Method::Generated::is_inline, avg 6µs/call
151}
152
1533120µs21.34ms
# spent 694µs (46+648) within Moose::Meta::Method::Accessor::Native::BEGIN@153 which was called: # once (46µs+648µs) by Class::MOP::__ANON__[/home/doy/coding/src/Class-MOP/blib/lib//Class/MOP.pm:118] at line 153
no Moose::Role;
# spent 694µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@153 # spent 648µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:557]
154
155153µs1;