Profile of Moose/Meta/Method/Accessor.pm

← 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
Statements | Executed 2445 statements in 8.35ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
252 | 4 | 2 | 2.18ms | 2.89ms | Moose::Meta::Method::Accessor::::_instance_is_inlinableMoose::Meta::Method::Accessor::_instance_is_inlinable
196 | 4 | 2 | 1.81ms | 101ms | Moose::Meta::Method::Accessor::::_compile_codeMoose::Meta::Method::Accessor::_compile_code
196 | 2 | 2 | 918µs | 31.9ms | Moose::Meta::Method::Accessor::::_eval_environmentMoose::Meta::Method::Accessor::_eval_environment
110 | 1 | 1 | 634µs | 96.9ms | Moose::Meta::Method::Accessor::::_generate_reader_methodMoose::Meta::Method::Accessor::_generate_reader_method
196 | 2 | 2 | 391µs | 391µs | Moose::Meta::Method::Accessor::::newMoose::Meta::Method::Accessor::new
50 | 2 | 2 | 285µs | 6.83ms | Moose::Meta::Method::Accessor::::_inline_check_lazyMoose::Meta::Method::Accessor::_inline_check_lazy
50 | 1 | 1 | 268µs | 1.25ms | Moose::Meta::Method::Accessor::::_get_valueMoose::Meta::Method::Accessor::_get_value
146 | 1 | 1 | 200µs | 200µs | Moose::Meta::Method::Accessor::::_newMoose::Meta::Method::Accessor::_new
30 | 1 | 1 | 191µs | 15.4ms | Moose::Meta::Method::Accessor::::_generate_predicate_methodMoose::Meta::Method::Accessor::_generate_predicate_method
14 | 2 | 1 | 77µs | 142µs | Moose::Meta::Method::Accessor::::_writer_value_needs_copyMoose::Meta::Method::Accessor::_writer_value_needs_copy
7 | 1 | 1 | 48µs | 89µs | Moose::Meta::Method::Accessor::::_inline_triggerMoose::Meta::Method::Accessor::_inline_trigger
5 | 1 | 1 | 37µs | 2.92ms | Moose::Meta::Method::Accessor::::_generate_writer_methodMoose::Meta::Method::Accessor::_generate_writer_method
1 | 1 | 1 | 10µs | 22µs | Moose::Meta::Method::Accessor::::BEGIN@4Moose::Meta::Method::Accessor::BEGIN@4
1 | 1 | 1 | 8µs | 12µs | Moose::Meta::Method::Accessor::::BEGIN@5Moose::Meta::Method::Accessor::BEGIN@5
1 | 1 | 1 | 8µs | 41µs | Moose::Meta::Method::Accessor::::BEGIN@9Moose::Meta::Method::Accessor::BEGIN@9
1 | 1 | 1 | 7µs | 179µs | Moose::Meta::Method::Accessor::::BEGIN@12Moose::Meta::Method::Accessor::BEGIN@12
1 | 1 | 1 | 6µs | 30µs | Moose::Meta::Method::Accessor::::BEGIN@7Moose::Meta::Method::Accessor::BEGIN@7
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::__ANON__[:35]Moose::Meta::Method::Accessor::__ANON__[:35]
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::__ANON__[:41]Moose::Meta::Method::Accessor::__ANON__[:41]
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_error_throwerMoose::Meta::Method::Accessor::_error_thrower
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_generate_accessor_methodMoose::Meta::Method::Accessor::_generate_accessor_method
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_generate_clearer_methodMoose::Meta::Method::Accessor::_generate_clearer_method
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_has_valueMoose::Meta::Method::Accessor::_has_value
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_inline_check_coercionMoose::Meta::Method::Accessor::_inline_check_coercion
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_inline_check_constraintMoose::Meta::Method::Accessor::_inline_check_constraint
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_inline_get_old_value_for_triggerMoose::Meta::Method::Accessor::_inline_get_old_value_for_trigger
0 | 0 | 0 | 0s | 0s | Moose::Meta::Method::Accessor::::_inline_store_valueMoose::Meta::Method::Accessor::_inline_store_value
0 | 0 | 0 | 0s | 0s | Moose::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
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Moose::Meta::Method::Accessor;
2 | 1 | 600ns |  |  | our $VERSION = '2.1604';
3 |  |  |  |  |
4 | 2 | 20µs | 2 | 34µ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
5 | 2 | 19µs | 2 | 16µ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 |  |  |  |  |
7 | 2 | 23µs | 2 | 53µ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 |  |  |  |  |
9 | 1 | 6µs | 1 | 34µ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
10 | 1 | 18µs | 1 | 41µs | 'Class::MOP::Method::Accessor'; # spent 41µs making 1 call to Moose::Meta::Method::Accessor::BEGIN@9
11 |  |  |  |  |
12 | 2 | 557µs | 2 | 351µ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 {
16 | 196 | 720µs | 196 | 218ms | 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 {
20 | 146 | 394µs | 146 | 34.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 |  |  |  |  |
23 |  |  |  |  | sub _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 {
31 | 196 | 43µs |  |  | my $self = shift;
32 | 196 | 109µs |  |  | my @args = @_;
33 |  |  |  |  | try {
34 | 196 | 639µs | 196 | 89.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 |  |  |  |  | );
41 | 196 | 1.52ms | 392 | 448µ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 {
45 | 196 | 54µs |  |  | my $self = shift;
46 | 196 | 781µs | 392 | 31.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 {
50 | 252 | 41µs |  |  | my $self = shift;
51 | 252 | 2.17ms | 1008 | 712µ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 {
55 | 110 | 33µs |  |  | my $self = shift;
56 | 110 | 494µs | 220 | 96.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 {
61 | 5 | 1µs |  |  | my $self = shift;
62 | 5 | 29µs | 10 | 2.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 |  |  |  |  |
66 |  |  |  |  | sub _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 {
73 | 30 | 10µs |  |  | my $self = shift;
74 | 30 | 165µs | 60 | 15.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 |  |  |  |  |
78 |  |  |  |  | sub _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 {
85 | 14 | 66µs | 28 | 65µ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 |  |  |  |  |
88 |  |  |  |  | sub _inline_tc_code {
89 |  |  |  |  | shift->associated_attribute->_inline_tc_code(@_);
90 |  |  |  |  | }
91 |  |  |  |  |
92 |  |  |  |  | sub _inline_check_coercion {
93 |  |  |  |  | shift->associated_attribute->_inline_check_coercion(@_);
94 |  |  |  |  | }
95 |  |  |  |  |
96 |  |  |  |  | sub _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 {
101 | 50 | 201µs | 100 | 6.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 |  |  |  |  |
104 |  |  |  |  | sub _inline_store_value {
105 |  |  |  |  | shift->associated_attribute->_inline_instance_set(@_) . ';';
106 |  |  |  |  | }
107 |  |  |  |  |
108 |  |  |  |  | sub _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 {
113 | 7 | 35µs | 14 | 42µ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 {
117 | 50 | 199µs | 100 | 977µ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 |  |  |  |  |
120 |  |  |  |  | sub _has_value {
121 |  |  |  |  | shift->associated_attribute->_inline_instance_has(@_);
122 |  |  |  |  | }
123 |  |  |  |  |
124 | 1 | 2µs |  |  | 1;
125 |  |  |  |  |
126 |  |  |  |  | # ABSTRACT: A Moose Method metaclass for accessors
127 |  |  |  |  |
128 |  |  |  |  | __END__