| Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP/Method/Generated.pm |
| Statements | Executed 2632 statements in 3.38ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 187 | 7 | 4 | 1.92ms | 57.5ms | Class::MOP::Method::Generated::_compile_code |
| 1 | 1 | 1 | 1.12ms | 1.31ms | Class::MOP::Method::Generated::BEGIN@14 |
| 187 | 1 | 1 | 1.11ms | 1.20ms | Class::MOP::Method::Generated::_generate_description |
| 1 | 1 | 1 | 8µs | 8µs | Class::MOP::Method::Generated::BEGIN@3 |
| 1 | 1 | 1 | 7µs | 60µs | Class::MOP::Method::Generated::BEGIN@16 |
| 1 | 1 | 1 | 6µs | 28µs | Class::MOP::Method::Generated::BEGIN@13 |
| 1 | 1 | 1 | 6µs | 9µs | Class::MOP::Method::Generated::BEGIN@11 |
| 1 | 1 | 1 | 5µs | 16µs | Class::MOP::Method::Generated::BEGIN@10 |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Generated::_initialize_body |
| 0 | 0 | 0 | 0s | 0s | Class::MOP::Method::Generated::new |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | package Class::MOP::Method::Generated; | ||||
| 3 | # spent 8µs within Class::MOP::Method::Generated::BEGIN@3 which was called:
# once (8µs+0s) by base::import at line 5 | ||||
| 4 | 1 | 4µs | $Class::MOP::Method::Generated::AUTHORITY = 'cpan:STEVAN'; | ||
| 5 | 1 | 26µs | 1 | 8µs | } # spent 8µs making 1 call to Class::MOP::Method::Generated::BEGIN@3 |
| 6 | { | ||||
| 7 | 2 | 1µs | $Class::MOP::Method::Generated::VERSION = '2.1005'; | ||
| 8 | } | ||||
| 9 | |||||
| 10 | 2 | 22µs | 2 | 26µs | # spent 16µs (5+10) within Class::MOP::Method::Generated::BEGIN@10 which was called:
# once (5µs+10µs) by base::import at line 10 # spent 16µs making 1 call to Class::MOP::Method::Generated::BEGIN@10
# spent 10µs making 1 call to strict::import |
| 11 | 2 | 24µs | 2 | 12µs | # spent 9µs (6+3) within Class::MOP::Method::Generated::BEGIN@11 which was called:
# once (6µs+3µs) by base::import at line 11 # spent 9µs making 1 call to Class::MOP::Method::Generated::BEGIN@11
# spent 3µs making 1 call to warnings::import |
| 12 | |||||
| 13 | 2 | 19µs | 2 | 50µs | # spent 28µs (6+22) within Class::MOP::Method::Generated::BEGIN@13 which was called:
# once (6µs+22µs) by base::import at line 13 # spent 28µs making 1 call to Class::MOP::Method::Generated::BEGIN@13
# spent 22µs making 1 call to Exporter::import |
| 14 | 2 | 94µs | 2 | 1.33ms | # spent 1.31ms (1.12+188µs) within Class::MOP::Method::Generated::BEGIN@14 which was called:
# once (1.12ms+188µs) by base::import at line 14 # spent 1.31ms making 1 call to Class::MOP::Method::Generated::BEGIN@14
# spent 24µs making 1 call to Exporter::import |
| 15 | |||||
| 16 | 2 | 243µs | 2 | 60µs | # spent 60µs (7+53) within Class::MOP::Method::Generated::BEGIN@16 which was called:
# once (7µs+53µs) by base::import at line 16 # spent 60µs making 1 call to Class::MOP::Method::Generated::BEGIN@16
# spent 53µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 53µs |
| 17 | |||||
| 18 | ## accessors | ||||
| 19 | |||||
| 20 | sub new { | ||||
| 21 | confess __PACKAGE__ . " is an abstract base class, you must provide a constructor."; | ||||
| 22 | } | ||||
| 23 | |||||
| 24 | sub _initialize_body { | ||||
| 25 | confess "No body to initialize, " . __PACKAGE__ . " is an abstract base class"; | ||||
| 26 | } | ||||
| 27 | |||||
| 28 | # spent 1.20ms (1.11+91µs) within Class::MOP::Method::Generated::_generate_description which was called 187 times, avg 6µs/call:
# 187 times (1.11ms+91µs) by Class::MOP::Method::Generated::_compile_code at line 63, avg 6µs/call | ||||
| 29 | 187 | 30µs | my ( $self, $context ) = @_; | ||
| 30 | 187 | 410µs | 187 | 91µs | $context ||= $self->definition_context; # spent 91µs making 187 calls to Class::MOP::Method::Generated::definition_context, avg 486ns/call |
| 31 | |||||
| 32 | 187 | 22µs | my $desc = "generated method"; | ||
| 33 | 187 | 19µs | my $origin = "unknown origin"; | ||
| 34 | |||||
| 35 | 187 | 22µs | if (defined $context) { | ||
| 36 | 187 | 67µs | if (defined $context->{description}) { | ||
| 37 | $desc = $context->{description}; | ||||
| 38 | } | ||||
| 39 | |||||
| 40 | 187 | 258µs | if (defined $context->{file} || defined $context->{line}) { | ||
| 41 | $origin = "defined at " | ||||
| 42 | . (defined $context->{file} | ||||
| 43 | ? $context->{file} : "<unknown file>") | ||||
| 44 | . " line " | ||||
| 45 | . (defined $context->{line} | ||||
| 46 | ? $context->{line} : "<unknown line>"); | ||||
| 47 | } | ||||
| 48 | } | ||||
| 49 | |||||
| 50 | 187 | 361µs | return "$desc ($origin)"; | ||
| 51 | } | ||||
| 52 | |||||
| 53 | # spent 57.5ms (1.92+55.6) within Class::MOP::Method::Generated::_compile_code which was called 187 times, avg 307µs/call:
# 61 times (709µs+22.2ms) by Moose::Meta::Method::Accessor::try {...} at line 38 of Moose/Meta/Method/Accessor.pm, avg 376µs/call
# 53 times (479µs+6.33ms) by Class::MOP::Method::Accessor::try {...} at line 142 of Class/MOP/Method/Accessor.pm, avg 128µs/call
# 31 times (343µs+22.2ms) by Class::MOP::Method::Constructor::try {...} at line 110 of Class/MOP/Method/Constructor.pm, avg 727µs/call
# 22 times (206µs+2.73ms) by Class::MOP::Method::Accessor::try {...} at line 112 of Class/MOP/Method/Accessor.pm, avg 133µs/call
# 16 times (142µs+1.64ms) by Class::MOP::Method::Accessor::try {...} at line 204 of Class/MOP/Method/Accessor.pm, avg 111µs/call
# 3 times (26µs+302µs) by Class::MOP::Method::Accessor::try {...} at line 179 of Class/MOP/Method/Accessor.pm, avg 110µs/call
# once (14µs+127µs) by Moose::Meta::Method::Destructor::try {...} at line 97 of Moose/Meta/Method/Destructor.pm | ||||
| 54 | 187 | 61µs | my ( $self, @args ) = @_; | ||
| 55 | 187 | 144µs | unshift @args, 'source' if @args % 2; | ||
| 56 | 187 | 97µs | my %args = @args; | ||
| 57 | |||||
| 58 | 187 | 60µs | my $context = delete $args{context}; | ||
| 59 | 187 | 563µs | 279 | 13.4ms | my $environment = $self->can('_eval_environment') # spent 7.77ms making 31 calls to Class::MOP::Method::Constructor::_eval_environment, avg 251µs/call
# spent 2.18ms making 35 calls to Moose::Meta::Method::Accessor::_eval_environment, avg 62µs/call
# spent 619µs making 4 calls to Moose::Meta::Class::__ANON__::SERIAL::6::_eval_environment, avg 155µs/call
# spent 607µs making 4 calls to Moose::Meta::Class::__ANON__::SERIAL::2::_eval_environment, avg 152µs/call
# spent 596µs making 4 calls to Moose::Meta::Class::__ANON__::SERIAL::3::_eval_environment, avg 149µs/call
# spent 492µs making 5 calls to Moose::Meta::Class::__ANON__::SERIAL::4::_eval_environment, avg 98µs/call
# spent 398µs making 4 calls to Moose::Meta::Class::__ANON__::SERIAL::7::_eval_environment, avg 100µs/call
# spent 372µs making 4 calls to Moose::Meta::Class::__ANON__::SERIAL::5::_eval_environment, avg 93µs/call
# spent 177µs making 1 call to Moose::Meta::Class::__ANON__::SERIAL::8::_eval_environment
# spent 155µs making 187 calls to UNIVERSAL::can, avg 829ns/call |
| 60 | ? $self->_eval_environment | ||||
| 61 | : {}; | ||||
| 62 | |||||
| 63 | 187 | 824µs | 374 | 42.2ms | return eval_closure( # spent 41.0ms making 187 calls to Eval::Closure::eval_closure, avg 219µs/call
# spent 1.20ms making 187 calls to Class::MOP::Method::Generated::_generate_description, avg 6µs/call |
| 64 | environment => $environment, | ||||
| 65 | description => $self->_generate_description($context), | ||||
| 66 | %args, | ||||
| 67 | ); | ||||
| 68 | } | ||||
| 69 | |||||
| 70 | 1 | 5µs | 1; | ||
| 71 | |||||
| 72 | # ABSTRACT: Abstract base class for generated methods | ||||
| 73 | |||||
| 74 | __END__ |