← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:15 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm
StatementsExecuted 1154 statements in 2.87ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2611409µs32.4msMoose::Meta::Method::Accessor::Native::::_initialize_bodyMoose::Meta::Method::Accessor::Native::_initialize_body
2622406µs7.35msMoose::Meta::Method::Accessor::Native::::_inline_check_argument_countMoose::Meta::Method::Accessor::Native::_inline_check_argument_count
6532284µs929µsMoose::Meta::Method::Accessor::Native::::_slot_access_can_be_inlinedMoose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined
2611182µs2.41msMoose::Meta::Method::Accessor::Native::::__ANON__[:156]Moose::Meta::Method::Accessor::Native::__ANON__[:156]
2611122µs1.41msMoose::Meta::Method::Accessor::Native::::__ANON__[:125]Moose::Meta::Method::Accessor::Native::__ANON__[:125]
2622103µs127µsMoose::Meta::Method::Accessor::Native::::_inline_curried_argumentsMoose::Meta::Method::Accessor::Native::_inline_curried_arguments
2622101µs141µsMoose::Meta::Method::Accessor::Native::::_inline_return_valueMoose::Meta::Method::Accessor::Native::_inline_return_value
261165µs65µsMoose::Meta::Method::Accessor::Native::::_newMoose::Meta::Method::Accessor::Native::_new
211119µs19µsMoose::Meta::Method::Accessor::Native::::root_typesMoose::Meta::Method::Accessor::Native::root_types
1119µs1.78msMoose::Meta::Method::Accessor::Native::::BEGIN@15Moose::Meta::Method::Accessor::Native::BEGIN@15
1119µs9µsMoose::Meta::Method::Accessor::Native::::BEGIN@2Moose::Meta::Method::Accessor::Native::BEGIN@2
17118µs8µsMoose::Meta::Method::Accessor::Native::::_minimum_argumentsMoose::Meta::Method::Accessor::Native::_minimum_arguments
1118µs31µsMoose::Meta::Method::Accessor::Native::::BEGIN@13Moose::Meta::Method::Accessor::Native::BEGIN@13
1117µs78µsMoose::Meta::Method::Accessor::Native::::BEGIN@164Moose::Meta::Method::Accessor::Native::BEGIN@164
1117µs29µsMoose::Meta::Method::Accessor::Native::::BEGIN@12Moose::Meta::Method::Accessor::Native::BEGIN@12
1116µs10µsMoose::Meta::Method::Accessor::Native::::BEGIN@10Moose::Meta::Method::Accessor::Native::BEGIN@10
1116µs16µsMoose::Meta::Method::Accessor::Native::::BEGIN@9Moose::Meta::Method::Accessor::Native::BEGIN@9
4113µs3µsMoose::Meta::Method::Accessor::Native::::_maximum_argumentsMoose::Meta::Method::Accessor::Native::_maximum_arguments
0000s0sMoose::Meta::Method::Accessor::Native::::__ANON__[:134]Moose::Meta::Method::Accessor::Native::__ANON__[:134]
0000s0sMoose::Meta::Method::Accessor::Native::::__ANON__[:43]Moose::Meta::Method::Accessor::Native::__ANON__[:43]
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
# spent 9µs within Moose::Meta::Method::Accessor::Native::BEGIN@2 which was called: # once (9µs+0s) by Module::Runtime::require_module at line 4
BEGIN {
314µs $Moose::Meta::Method::Accessor::Native::AUTHORITY = 'cpan:STEVAN';
4131µs19µs}
# spent 9µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@2
5{
62700ns $Moose::Meta::Method::Accessor::Native::VERSION = '2.1005';
7}
8
9221µs227µs
# spent 16µs (6+10) within Moose::Meta::Method::Accessor::Native::BEGIN@9 which was called: # once (6µs+10µs) by Module::Runtime::require_module at line 9
use strict;
# spent 16µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@9 # spent 10µs making 1 call to strict::import
10222µs213µs
# spent 10µs (6+3) within Moose::Meta::Method::Accessor::Native::BEGIN@10 which was called: # once (6µs+3µs) by Module::Runtime::require_module at line 10
use warnings;
# spent 10µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@10 # spent 3µs making 1 call to warnings::import
11
12224µs252µs
# spent 29µs (7+23) within Moose::Meta::Method::Accessor::Native::BEGIN@12 which was called: # once (7µs+23µs) by Module::Runtime::require_module at line 12
use Carp qw( confess );
# spent 29µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@12 # spent 23µs making 1 call to Exporter::import
13225µs254µs
# spent 31µs (8+23) within Moose::Meta::Method::Accessor::Native::BEGIN@13 which was called: # once (8µs+23µs) by Module::Runtime::require_module at line 13
use Scalar::Util qw( blessed weaken );
# spent 31µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@13 # spent 23µs making 1 call to Exporter::import
14
152677µs23.55ms
# spent 1.78ms (9µs+1.77) within Moose::Meta::Method::Accessor::Native::BEGIN@15 which was called: # once (9µs+1.77ms) by Module::Runtime::require_module at line 15
use Moose::Role;
# spent 1.78ms making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@15 # spent 1.77ms making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:519]
16
17around new => sub {
18263µs my $orig = shift;
19263µs my $class = shift;
202647µs my %options = @_;
21
22267µs $options{curried_arguments} = []
23 unless exists $options{curried_arguments};
24
252611µs confess 'You must supply a curried_arguments which is an ARRAY reference'
26 unless $options{curried_arguments}
27 && ref($options{curried_arguments}) eq 'ARRAY';
28
292665µs2616µs my $attr_context = $options{attribute}->definition_context;
# spent 16µs making 26 calls to Class::MOP::Mixin::AttributeCore::definition_context, avg 596ns/call
30263µs my $desc = 'native delegation method ';
312689µs5221µs $desc .= $options{attribute}->associated_class->name;
# spent 11µs making 26 calls to Class::MOP::Attribute::associated_class, avg 408ns/call # spent 10µs making 26 calls to Class::MOP::Package::name, avg 388ns/call
32268µs $desc .= '::' . $options{name};
33266µs $desc .= " ($options{delegate_to_method})";
342653µs2610µs $desc .= " of attribute " . $options{attribute}->name;
# spent 10µs making 26 calls to Class::MOP::Mixin::AttributeCore::name, avg 404ns/call
35 $options{definition_context} = {
362677µs %{ $attr_context || {} },
37 description => $desc,
38 };
39
40268µs $options{accessor_type} = 'native';
41
4226102µs2638µs return $class->$orig(%options);
# spent 38µs making 26 calls to Moose::Meta::Method::Accessor::new, avg 1µs/call
4314µs146µs};
# spent 46µs making 1 call to Moose::Role::around
44
45
# spent 65µs within Moose::Meta::Method::Accessor::Native::_new which was called 26 times, avg 3µs/call: # 26 times (65µs+0s) by Class::MOP::Method::Accessor::new at line 35 of Class/MOP/Method/Accessor.pm, avg 3µs/call
sub _new {
46265µs my $class = shift;
47268µs my $options = @_ == 1 ? $_[0] : {@_};
48
492667µs return bless $options, $class;
50}
51
522134µs
# spent 19µs within Moose::Meta::Method::Accessor::Native::root_types which was called 21 times, avg 886ns/call: # 21 times (19µs+0s) by Moose::Meta::Method::Accessor::Native::Writer::_is_root_type at line 107 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 886ns/call
sub root_types { (shift)->{'root_types'} }
53
54
# spent 32.4ms (409µs+32.0) within Moose::Meta::Method::Accessor::Native::_initialize_body which was called 26 times, avg 1.25ms/call: # 26 times (409µs+32.0ms) by Class::MOP::Method::Accessor::new at line 42 of Class/MOP/Method/Accessor.pm, avg 1.25ms/call
sub _initialize_body {
55263µs my $self = shift;
56
5726336µs5232.0ms $self->{'body'} = $self->_compile_code( [$self->_generate_method] );
# spent 12.2ms making 26 calls to Moose::Meta::Method::Accessor::_compile_code, avg 471µs/call # spent 10.5ms making 13 calls to Moose::Meta::Method::Accessor::Native::Reader::_generate_method, avg 808µs/call # spent 9.22ms making 13 calls to Moose::Meta::Method::Accessor::Native::Writer::_generate_method, avg 709µs/call
58
592642µs return;
60}
61
62
# spent 127µs (103+24) within Moose::Meta::Method::Accessor::Native::_inline_curried_arguments which was called 26 times, avg 5µs/call: # 13 times (54µs+12µs) by Moose::Meta::Method::Accessor::Native::Writer::_generate_method at line 28 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 5µs/call # 13 times (49µs+13µs) by Moose::Meta::Method::Accessor::Native::Reader::_generate_method at line 25 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 5µs/call
sub _inline_curried_arguments {
63263µs my $self = shift;
64
652690µs2624µs return unless @{ $self->curried_arguments };
# spent 24µs making 26 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 931ns/call
66
67 return 'unshift @_, @curried;';
68}
69
70
# spent 7.35ms (406µs+6.95) within Moose::Meta::Method::Accessor::Native::_inline_check_argument_count which was called 26 times, avg 283µs/call: # 13 times (207µs+5.58ms) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 38 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 445µs/call # 13 times (199µs+1.36ms) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 44 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 120µs/call
sub _inline_check_argument_count {
71263µs my $self = shift;
72
73261µs my @code;
74
752676µs44884µs if (my $min = $self->_minimum_arguments) {
# spent 859µs making 9 calls to Moose::Meta::Method::_inline_throw_error, avg 95µs/call # spent 8µs making 17 calls to Moose::Meta::Method::Accessor::Native::_minimum_arguments, avg 500ns/call # spent 8µs making 9 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 944ns/call # spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::set::_minimum_arguments, avg 1µs/call # spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::get::_minimum_arguments, avg 850ns/call # spent 800ns making 1 call to Moose::Meta::Method::Accessor::Native::Array::delete::_minimum_arguments
76 push @code, (
77 'if (@_ < ' . $min . ') {',
78 $self->_inline_throw_error(
79 sprintf(
80 '"Cannot call %s without at least %s argument%s"',
81 $self->delegate_to_method,
82 $min,
83 ($min == 1 ? '' : 's'),
84 )
85 ) . ';',
86 '}',
87 );
88 }
89
9026140µs706.06ms if (defined(my $max = $self->_maximum_arguments)) {
# spent 6.01ms making 22 calls to Moose::Meta::Method::_inline_throw_error, avg 273µs/call # spent 24µs making 22 calls to Moose::Meta::Method::Delegation::delegate_to_method, avg 1µs/call # spent 5µs making 5 calls to Moose::Meta::Method::Accessor::Native::Array::count::_maximum_arguments, avg 920ns/call # spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::set::_maximum_arguments, avg 1µs/call # spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::get::_maximum_arguments, avg 925ns/call # spent 4µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::clear::_maximum_arguments, avg 900ns/call # spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::elements::_maximum_arguments, avg 850ns/call # spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::_maximum_arguments, avg 850ns/call # spent 700ns making 1 call to Moose::Meta::Method::Accessor::Native::Array::delete::_maximum_arguments
91 push @code, (
92 'if (@_ > ' . $max . ') {',
93 $self->_inline_throw_error(
94 sprintf(
95 '"Cannot call %s with %s argument%s"',
96 $self->delegate_to_method,
97 $max ? "more than $max" : 'any',
98 ($max == 1 ? '' : 's'),
99 )
100 ) . ';',
101 '}',
102 );
103 }
104
1052674µs return @code;
106}
107
108
# spent 141µs (101+40) within Moose::Meta::Method::Accessor::Native::_inline_return_value which was called 26 times, avg 5µs/call: # 13 times (52µs+26µs) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 38 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 6µs/call # 13 times (49µs+15µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 57 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 5µs/call
sub _inline_return_value {
109263µs my $self = shift;
110266µs my ($slot_access, $for_writer) = @_;
111
1122665µs2640µs return 'return ' . $self->_return_value($slot_access, $for_writer) . ';';
# spent 10µs making 5 calls to Moose::Meta::Method::Accessor::Native::Array::count::_return_value, avg 2µs/call # spent 8µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::elements::_return_value, avg 2µs/call # spent 8µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::get::_return_value, avg 2µs/call # spent 5µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::push::_return_value, avg 1µs/call # spent 5µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::set::_return_value, avg 1µs/call # spent 3µs making 4 calls to Moose::Meta::Method::Accessor::Native::Array::clear::_return_value, avg 650ns/call # spent 1µs making 1 call to Moose::Meta::Method::Accessor::Native::Array::delete::_return_value
113}
114
1151725µs
# spent 8µs within Moose::Meta::Method::Accessor::Native::_minimum_arguments which was called 17 times, avg 500ns/call: # 17 times (8µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 75, avg 500ns/call
sub _minimum_arguments { 0 }
11647µs
# spent 3µs within Moose::Meta::Method::Accessor::Native::_maximum_arguments which was called 4 times, avg 850ns/call: # 4 times (3µs+0s) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 90, avg 850ns/call
sub _maximum_arguments { undef }
117
118
# spent 1.41ms (122µs+1.29) within Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:125] which was called 26 times, avg 54µs/call: # 26 times (122µs+1.29ms) by 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::7::_get_value or Moose::Meta::Class::__ANON__::SERIAL::8::_get_value at line 38 of Moose/Meta/Method/Overridden.pm, avg 54µs/call
override _get_value => sub {
119263µs my $self = shift;
120265µs my ($instance) = @_;
121
1222691µs521.29ms return $self->_slot_access_can_be_inlined
# spent 878µs making 26 calls to Moose::Role::super, avg 34µs/call # spent 408µs making 26 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 16µs/call
123 ? super()
124 : $instance . '->$reader';
12512µs156µs};
# spent 56µs making 1 call to Moose::Role::override
126
127override _inline_store_value => sub {
128 my $self = shift;
129 my ($instance, $value) = @_;
130
131 return $self->_slot_access_can_be_inlined
132 ? super()
133 : $instance . '->$writer(' . $value . ');';
13412µs134µs};
# spent 34µs making 1 call to Moose::Role::override
135
136
# spent 2.41ms (182µs+2.23) within Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:156] which was called 26 times, avg 93µs/call: # 26 times (182µs+2.23ms) by 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::7::_eval_environment or Moose::Meta::Class::__ANON__::SERIAL::8::_eval_environment at line 38 of Moose/Meta/Method/Overridden.pm, avg 93µs/call
override _eval_environment => sub {
137263µs my $self = shift;
138
1392618µs261.85ms my $env = super();
# spent 1.85ms making 26 calls to Moose::Role::super, avg 71µs/call
140
1412630µs2626µs $env->{'@curried'} = $self->curried_arguments;
# spent 26µs making 26 calls to Moose::Meta::Method::Delegation::curried_arguments, avg 985ns/call
142
1432672µs26353µs return $env if $self->_slot_access_can_be_inlined;
# spent 353µs making 26 calls to Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined, avg 14µs/call
144
145 my $reader = $self->associated_attribute->get_read_method_ref;
146 $reader = $reader->body if blessed $reader;
147
148 $env->{'$reader'} = \$reader;
149
150 my $writer = $self->associated_attribute->get_write_method_ref;
151 $writer = $writer->body if blessed $writer;
152
153 $env->{'$writer'} = \$writer;
154
155 return $env;
15612µs131µs};
# spent 31µs making 1 call to Moose::Role::override
157
158
# spent 929µs (284+645) within Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined which was called 65 times, avg 14µs/call: # 26 times (134µs+274µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:125] at line 122, avg 16µs/call # 26 times (103µs+250µs) by Moose::Meta::Method::Accessor::Native::__ANON__[/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method/Accessor/Native.pm:156] at line 143, avg 14µs/call # 13 times (47µs+121µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 149 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 13µs/call
sub _slot_access_can_be_inlined {
159655µs my $self = shift;
160
16165314µs130645µs return $self->is_inline && $self->_instance_is_inlinable;
# spent 611µs making 65 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 9µs/call # spent 34µs making 65 calls to Class::MOP::Method::Generated::is_inline, avg 523ns/call
162}
163
164230µs2148µs
# spent 78µs (7+70) within Moose::Meta::Method::Accessor::Native::BEGIN@164 which was called: # once (7µs+70µs) by Module::Runtime::require_module at line 164
no Moose::Role;
# spent 78µs making 1 call to Moose::Meta::Method::Accessor::Native::BEGIN@164 # spent 70µs making 1 call to Moose::Exporter::__ANON__[Moose/Exporter.pm:706]
165
16619µs1;