← 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:10 2016

Filename/usr/local/lib/perl/5.18.2/Moose/Meta/Method/Accessor.pm
StatementsExecuted 2445 statements in 8.35ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
252422.18ms2.89msMoose::Meta::Method::Accessor::::_instance_is_inlinableMoose::Meta::Method::Accessor::_instance_is_inlinable
196421.81ms101msMoose::Meta::Method::Accessor::::_compile_codeMoose::Meta::Method::Accessor::_compile_code
19622918µs31.9msMoose::Meta::Method::Accessor::::_eval_environmentMoose::Meta::Method::Accessor::_eval_environment
11011634µs96.9msMoose::Meta::Method::Accessor::::_generate_reader_methodMoose::Meta::Method::Accessor::_generate_reader_method
19622391µs391µsMoose::Meta::Method::Accessor::::newMoose::Meta::Method::Accessor::new
5022285µs6.83msMoose::Meta::Method::Accessor::::_inline_check_lazyMoose::Meta::Method::Accessor::_inline_check_lazy
5011268µs1.25msMoose::Meta::Method::Accessor::::_get_valueMoose::Meta::Method::Accessor::_get_value
14611200µs200µsMoose::Meta::Method::Accessor::::_newMoose::Meta::Method::Accessor::_new
3011191µs15.4msMoose::Meta::Method::Accessor::::_generate_predicate_methodMoose::Meta::Method::Accessor::_generate_predicate_method
142177µs142µsMoose::Meta::Method::Accessor::::_writer_value_needs_copyMoose::Meta::Method::Accessor::_writer_value_needs_copy
71148µs89µsMoose::Meta::Method::Accessor::::_inline_triggerMoose::Meta::Method::Accessor::_inline_trigger
51137µs2.92msMoose::Meta::Method::Accessor::::_generate_writer_methodMoose::Meta::Method::Accessor::_generate_writer_method
11110µs22µsMoose::Meta::Method::Accessor::::BEGIN@4Moose::Meta::Method::Accessor::BEGIN@4
1118µs12µsMoose::Meta::Method::Accessor::::BEGIN@5Moose::Meta::Method::Accessor::BEGIN@5
1118µs41µsMoose::Meta::Method::Accessor::::BEGIN@9Moose::Meta::Method::Accessor::BEGIN@9
1117µs179µsMoose::Meta::Method::Accessor::::BEGIN@12Moose::Meta::Method::Accessor::BEGIN@12
1116µs30µsMoose::Meta::Method::Accessor::::BEGIN@7Moose::Meta::Method::Accessor::BEGIN@7
0000s0sMoose::Meta::Method::Accessor::::__ANON__[:35]Moose::Meta::Method::Accessor::__ANON__[:35]
0000s0sMoose::Meta::Method::Accessor::::__ANON__[:41]Moose::Meta::Method::Accessor::__ANON__[:41]
0000s0sMoose::Meta::Method::Accessor::::_error_throwerMoose::Meta::Method::Accessor::_error_thrower
0000s0sMoose::Meta::Method::Accessor::::_generate_accessor_methodMoose::Meta::Method::Accessor::_generate_accessor_method
0000s0sMoose::Meta::Method::Accessor::::_generate_clearer_methodMoose::Meta::Method::Accessor::_generate_clearer_method
0000s0sMoose::Meta::Method::Accessor::::_has_valueMoose::Meta::Method::Accessor::_has_value
0000s0sMoose::Meta::Method::Accessor::::_inline_check_coercionMoose::Meta::Method::Accessor::_inline_check_coercion
0000s0sMoose::Meta::Method::Accessor::::_inline_check_constraintMoose::Meta::Method::Accessor::_inline_check_constraint
0000s0sMoose::Meta::Method::Accessor::::_inline_get_old_value_for_triggerMoose::Meta::Method::Accessor::_inline_get_old_value_for_trigger
0000s0sMoose::Meta::Method::Accessor::::_inline_store_valueMoose::Meta::Method::Accessor::_inline_store_value
0000s0sMoose::Meta::Method::Accessor::::_inline_tc_codeMoose::Meta::Method::Accessor::_inline_tc_code
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;
21600nsour $VERSION = '2.1604';
3
4220µs234µs
# spent 22µs (10+12) within Moose::Meta::Method::Accessor::BEGIN@4 which was called: # once (10µs+12µs) by Moose::Meta::Attribute::BEGIN@13 at line 4
use strict;
# spent 22µs making 1 call to Moose::Meta::Method::Accessor::BEGIN@4 # spent 12µs making 1 call to strict::import
5219µs216µs
# spent 12µs (8+4) within Moose::Meta::Method::Accessor::BEGIN@5 which was called: # once (8µs+4µs) by Moose::Meta::Attribute::BEGIN@13 at line 5
use warnings;
# spent 12µs making 1 call to Moose::Meta::Method::Accessor::BEGIN@5 # spent 4µs making 1 call to warnings::import
6
7223µs253µs
# spent 30µs (6+23) within Moose::Meta::Method::Accessor::BEGIN@7 which was called: # once (6µs+23µs) by Moose::Meta::Attribute::BEGIN@13 at line 7
use Try::Tiny;
# spent 30µs making 1 call to Moose::Meta::Method::Accessor::BEGIN@7 # spent 23µs making 1 call to Exporter::import
8
916µs134µs
# spent 41µs (8+34) within Moose::Meta::Method::Accessor::BEGIN@9 which was called: # once (8µs+34µs) by Moose::Meta::Attribute::BEGIN@13 at line 10
use parent 'Moose::Meta::Method',
# spent 34µs making 1 call to parent::import
10118µs141µs 'Class::MOP::Method::Accessor';
# spent 41µs making 1 call to Moose::Meta::Method::Accessor::BEGIN@9
11
122557µs2351µs
# spent 179µs (7+172) within Moose::Meta::Method::Accessor::BEGIN@12 which was called: # once (7µs+172µs) by Moose::Meta::Attribute::BEGIN@13 at line 12
use Moose::Util 'throw_exception';
# spent 179µs making 1 call to Moose::Meta::Method::Accessor::BEGIN@12 # spent 172µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:337]
13
14# multiple inheritance is terrible
15
# spent 391µs within Moose::Meta::Method::Accessor::new which was called 196 times, avg 2µs/call: # 146 times (283µs+0s) by Class::MOP::Attribute::try {...} at line 407 of Class/MOP/Attribute.pm, avg 2µs/call # 50 times (108µs+0s) by Class::MOP::Class:::around at line 41 of Moose/Meta/Method/Accessor/Native.pm, avg 2µs/call
sub new {
16196720µs196218ms goto &Class::MOP::Method::Accessor::new;
# spent 218ms making 196 calls to Class::MOP::Method::Accessor::new, avg 1.11ms/call
17}
18
19
# spent 200µs within Moose::Meta::Method::Accessor::_new which was called 146 times, avg 1µs/call: # 146 times (200µs+0s) by Class::MOP::Method::Accessor::new at line 36 of Class/MOP/Method/Accessor.pm, avg 1µs/call
sub _new {
20146394µs14634.7ms goto &Class::MOP::Method::Accessor::_new;
# spent 34.7ms making 146 calls to Class::MOP::Method::Accessor::_new, avg 237µs/call
21}
22
23sub _error_thrower {
24 my $self = shift;
25 return $self->associated_attribute
26 if ref($self) && defined($self->associated_attribute);
27 return $self->SUPER::_error_thrower;
28}
29
30
# spent 101ms (1.81+98.9) within Moose::Meta::Method::Accessor::_compile_code which was called 196 times, avg 514µs/call: # 111 times (1.04ms+51.5ms) by Class::MOP::Method::Accessor::try {...} at line 151 of Class/MOP/Method/Accessor.pm, avg 473µs/call # 50 times (524µs+32.8ms) by Moose::Meta::Method::Accessor::Native::_initialize_body at line 56 of Moose/Meta/Method/Accessor/Native.pm, avg 667µs/call # 30 times (212µs+12.8ms) by Class::MOP::Method::Accessor::try {...} at line 219 of Class/MOP/Method/Accessor.pm, avg 435µs/call # 5 times (36µs+1.74ms) by Class::MOP::Method::Accessor::try {...} at line 191 of Class/MOP/Method/Accessor.pm, avg 355µs/call
sub _compile_code {
3119643µs my $self = shift;
32196109µs my @args = @_;
33 try {
34196639µs19689.9ms $self->SUPER::_compile_code(@args);
# spent 89.9ms making 196 calls to Class::MOP::Method::Generated::_compile_code, avg 459µs/call
35 }
36 catch {
37 throw_exception( CouldNotCreateWriter => attribute => $self->associated_attribute,
38 error => $_,
39 instance => $self
40 );
411961.52ms392448µs };
# spent 448µs making 196 calls to Try::Tiny::catch, avg 2µs/call # spent 98.4ms making 196 calls to Try::Tiny::try, avg 502µs/call, recursion: max depth 3, sum of overlapping time 98.4ms
42}
43
44
# spent 31.9ms (918µs+31.0) within Moose::Meta::Method::Accessor::_eval_environment which was called 196 times, avg 163µs/call: # 146 times (670µs+20.9ms) by Class::MOP::Method::Generated::_compile_code at line 52 of Class/MOP/Method/Generated.pm, avg 148µs/call # 50 times (249µs+10.1ms) by Moose::Role::super at line 77 of Moose/Role.pm, avg 208µs/call
sub _eval_environment {
4519654µs my $self = shift;
46196781µs39231.0ms return $self->associated_attribute->_eval_environment;
# spent 30.8ms making 196 calls to Moose::Meta::Attribute::_eval_environment, avg 157µs/call # spent 214µs making 196 calls to Class::MOP::Method::Accessor::associated_attribute, avg 1µs/call
47}
48
49
# spent 2.89ms (2.18+711µs) within Moose::Meta::Method::Accessor::_instance_is_inlinable which was called 252 times, avg 11µs/call: # 110 times (968µs+322µs) by Moose::Meta::Method::Accessor::_generate_reader_method at line 56, avg 12µs/call # 107 times (940µs+310µs) by Moose::Meta::Method::Accessor::Native::_slot_access_can_be_inlined at line 152 of Moose/Meta/Method/Accessor/Native.pm, avg 12µs/call # 30 times (233µs+68µs) by Moose::Meta::Method::Accessor::_generate_predicate_method at line 74, avg 10µs/call # 5 times (40µs+11µs) by Moose::Meta::Method::Accessor::_generate_writer_method at line 62, avg 10µs/call
sub _instance_is_inlinable {
5025241µs my $self = shift;
512522.17ms1008712µs return $self->associated_attribute->associated_class->instance_metaclass->is_inlinable;
# spent 238µs making 252 calls to Class::MOP::Method::Accessor::associated_attribute, avg 943ns/call # spent 220µs making 252 calls to Class::MOP::Instance::is_inlinable, avg 872ns/call # spent 141µs making 252 calls to Class::MOP::Class::instance_metaclass, avg 560ns/call # spent 113µs making 252 calls to Class::MOP::Attribute::associated_class, avg 448ns/call
52}
53
54
# spent 96.9ms (634µs+96.2) within Moose::Meta::Method::Accessor::_generate_reader_method which was called 110 times, avg 881µs/call: # 110 times (634µs+96.2ms) by Class::MOP::Method::Accessor::_initialize_body at line 91 of Class/MOP/Method/Accessor.pm, avg 881µs/call
sub _generate_reader_method {
5511033µs my $self = shift;
56110494µs22096.2ms $self->_instance_is_inlinable ? $self->_generate_reader_method_inline(@_)
# spent 94.9ms making 110 calls to Class::MOP::Method::Accessor::_generate_reader_method_inline, avg 863µs/call # spent 1.29ms making 110 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 12µs/call
57 : $self->SUPER::_generate_reader_method(@_);
58}
59
60
# spent 2.92ms (37µs+2.88) within Moose::Meta::Method::Accessor::_generate_writer_method which was called 5 times, avg 584µs/call: # 5 times (37µs+2.88ms) by Class::MOP::Method::Accessor::_initialize_body at line 91 of Class/MOP/Method/Accessor.pm, avg 584µs/call
sub _generate_writer_method {
6151µs my $self = shift;
62529µs102.88ms $self->_instance_is_inlinable ? $self->_generate_writer_method_inline(@_)
# spent 2.83ms making 5 calls to Class::MOP::Method::Accessor::_generate_writer_method_inline, avg 566µs/call # spent 51µs making 5 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 10µs/call
63 : $self->SUPER::_generate_writer_method(@_);
64}
65
66sub _generate_accessor_method {
67 my $self = shift;
68 $self->_instance_is_inlinable ? $self->_generate_accessor_method_inline(@_)
69 : $self->SUPER::_generate_accessor_method(@_);
70}
71
72
# spent 15.4ms (191µs+15.2) within Moose::Meta::Method::Accessor::_generate_predicate_method which was called 30 times, avg 513µs/call: # 30 times (191µs+15.2ms) by Class::MOP::Method::Accessor::_initialize_body at line 91 of Class/MOP/Method/Accessor.pm, avg 513µs/call
sub _generate_predicate_method {
733010µs my $self = shift;
7430165µs6015.2ms $self->_instance_is_inlinable ? $self->_generate_predicate_method_inline(@_)
# spent 14.9ms making 30 calls to Class::MOP::Method::Accessor::_generate_predicate_method_inline, avg 497µs/call # spent 301µs making 30 calls to Moose::Meta::Method::Accessor::_instance_is_inlinable, avg 10µs/call
75 : $self->SUPER::_generate_predicate_method(@_);
76}
77
78sub _generate_clearer_method {
79 my $self = shift;
80 $self->_instance_is_inlinable ? $self->_generate_clearer_method_inline(@_)
81 : $self->SUPER::_generate_clearer_method(@_);
82}
83
84
# spent 142µs (77+65) within Moose::Meta::Method::Accessor::_writer_value_needs_copy which was called 14 times, avg 10µs/call: # 7 times (48µs+36µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_copy_native_value at line 111 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 12µs/call # 7 times (28µs+30µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_set_new_value at line 145 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 8µs/call
sub _writer_value_needs_copy {
851466µs2865µs shift->associated_attribute->_writer_value_needs_copy(@_);
# spent 56µs making 14 calls to Moose::Meta::Attribute::_writer_value_needs_copy, avg 4µs/call # spent 9µs making 14 calls to Class::MOP::Method::Accessor::associated_attribute, avg 657ns/call
86}
87
88sub _inline_tc_code {
89 shift->associated_attribute->_inline_tc_code(@_);
90}
91
92sub _inline_check_coercion {
93 shift->associated_attribute->_inline_check_coercion(@_);
94}
95
96sub _inline_check_constraint {
97 shift->associated_attribute->_inline_check_constraint(@_);
98}
99
100
# spent 6.83ms (285µs+6.55) within Moose::Meta::Method::Accessor::_inline_check_lazy which was called 50 times, avg 137µs/call: # 43 times (245µs+4.93ms) by Moose::Meta::Method::Accessor::Native::Reader::_inline_reader_core at line 33 of Moose/Meta/Method/Accessor/Native/Reader.pm, avg 120µs/call # 7 times (40µs+1.61ms) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 39 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 236µs/call
sub _inline_check_lazy {
10150201µs1006.55ms shift->associated_attribute->_inline_check_lazy(@_);
# spent 6.51ms making 50 calls to Moose::Meta::Attribute::_inline_check_lazy, avg 130µs/call # spent 34µs making 50 calls to Class::MOP::Method::Accessor::associated_attribute, avg 678ns/call
102}
103
104sub _inline_store_value {
105 shift->associated_attribute->_inline_instance_set(@_) . ';';
106}
107
108sub _inline_get_old_value_for_trigger {
109 shift->associated_attribute->_inline_get_old_value_for_trigger(@_);
110}
111
112
# spent 89µs (48+42) within Moose::Meta::Method::Accessor::_inline_trigger which was called 7 times, avg 13µs/call: # 7 times (48µs+42µs) by Moose::Meta::Method::Accessor::Native::Writer::_inline_writer_core at line 52 of Moose/Meta/Method/Accessor/Native/Writer.pm, avg 13µs/call
sub _inline_trigger {
113735µs1442µs shift->associated_attribute->_inline_trigger(@_);
# spent 36µs making 7 calls to Moose::Meta::Attribute::_inline_trigger, avg 5µs/call # spent 6µs making 7 calls to Class::MOP::Method::Accessor::associated_attribute, avg 786ns/call
114}
115
116
# spent 1.25ms (268µs+977µs) within Moose::Meta::Method::Accessor::_get_value which was called 50 times, avg 25µs/call: # 50 times (268µs+977µs) by Moose::Role::super at line 77 of Moose/Role.pm, avg 25µs/call
sub _get_value {
11750199µs100977µs shift->associated_attribute->_inline_instance_get(@_);
# spent 948µs making 50 calls to Class::MOP::Attribute::_inline_instance_get, avg 19µs/call # spent 30µs making 50 calls to Class::MOP::Method::Accessor::associated_attribute, avg 596ns/call
118}
119
120sub _has_value {
121 shift->associated_attribute->_inline_instance_has(@_);
122}
123
12412µs1;
125
126# ABSTRACT: A Moose Method metaclass for accessors
127
128__END__