| Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Method/Generate/BuildAll.pm |
| Statements | Executed 30 statements in 512µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 3 | 1 | 1 | 81µs | 135µs | Method::Generate::BuildAll::buildall_body_for |
| 1 | 1 | 1 | 34µs | 38µs | Method::Generate::BuildAll::BEGIN@2 |
| 1 | 1 | 1 | 12µs | 12µs | Method::Generate::BuildAll::BEGIN@6 |
| 1 | 1 | 1 | 9µs | 44µs | Method::Generate::BuildAll::BEGIN@3 |
| 1 | 1 | 1 | 9µs | 55µs | Method::Generate::BuildAll::BEGIN@7 |
| 1 | 1 | 1 | 5µs | 5µs | Method::Generate::BuildAll::BEGIN@5 |
| 1 | 1 | 1 | 5µs | 24µs | Method::Generate::BuildAll::BEGIN@8 |
| 0 | 0 | 0 | 0s | 0s | Method::Generate::BuildAll::_handle_subbuild |
| 0 | 0 | 0 | 0s | 0s | Method::Generate::BuildAll::generate_method |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Method::Generate::BuildAll; | ||||
| 2 | 2 | 43µs | 2 | 42µs | # spent 38µs (34+4) within Method::Generate::BuildAll::BEGIN@2 which was called:
# once (34µs+4µs) by Method::Generate::Constructor::buildall_generator at line 2 # spent 38µs making 1 call to Method::Generate::BuildAll::BEGIN@2
# spent 4µs making 1 call to strict::import |
| 3 | 2 | 28µs | 2 | 79µs | # spent 44µs (9+35) within Method::Generate::BuildAll::BEGIN@3 which was called:
# once (9µs+35µs) by Method::Generate::Constructor::buildall_generator at line 3 # spent 44µs making 1 call to Method::Generate::BuildAll::BEGIN@3
# spent 35µs making 1 call to warnings::import |
| 4 | |||||
| 5 | 2 | 45µs | 1 | 5µs | # spent 5µs within Method::Generate::BuildAll::BEGIN@5 which was called:
# once (5µs+0s) by Method::Generate::Constructor::buildall_generator at line 5 # spent 5µs making 1 call to Method::Generate::BuildAll::BEGIN@5 |
| 6 | 1 | 35µs | 1 | 12µs | # spent 12µs within Method::Generate::BuildAll::BEGIN@6 which was called:
# once (12µs+0s) by Method::Generate::Constructor::buildall_generator at line 6 # spent 12µs making 1 call to Method::Generate::BuildAll::BEGIN@6 |
| 7 | 2 | 29µs | 2 | 101µs | # spent 55µs (9+46) within Method::Generate::BuildAll::BEGIN@7 which was called:
# once (9µs+46µs) by Method::Generate::Constructor::buildall_generator at line 7 # spent 55µs making 1 call to Method::Generate::BuildAll::BEGIN@7
# spent 46µs making 1 call to Exporter::import |
| 8 | 2 | 237µs | 2 | 43µs | # spent 24µs (5+19) within Method::Generate::BuildAll::BEGIN@8 which was called:
# once (5µs+19µs) by Method::Generate::Constructor::buildall_generator at line 8 # spent 24µs making 1 call to Method::Generate::BuildAll::BEGIN@8
# spent 19µs making 1 call to Exporter::import |
| 9 | |||||
| 10 | sub generate_method { | ||||
| 11 | my ($self, $into) = @_; | ||||
| 12 | quote_sub "${into}::BUILDALL" | ||||
| 13 | => join('', | ||||
| 14 | $self->_handle_subbuild($into), | ||||
| 15 | qq{ my \$self = shift;\n}, | ||||
| 16 | $self->buildall_body_for($into, '$self', '@_'), | ||||
| 17 | qq{ return \$self\n}, | ||||
| 18 | ) | ||||
| 19 | => {} | ||||
| 20 | => { no_defer => 1 } | ||||
| 21 | ; | ||||
| 22 | } | ||||
| 23 | |||||
| 24 | sub _handle_subbuild { | ||||
| 25 | my ($self, $into) = @_; | ||||
| 26 | ' if (ref($_[0]) ne '.quotify($into).') {'."\n". | ||||
| 27 | ' return shift->Moo::Object::BUILDALL(@_)'.";\n". | ||||
| 28 | ' }'."\n"; | ||||
| 29 | } | ||||
| 30 | |||||
| 31 | # spent 135µs (81+54) within Method::Generate::BuildAll::buildall_body_for which was called 3 times, avg 45µs/call:
# 3 times (81µs+54µs) by Method::Generate::Constructor::generate_method at line 138 of Method/Generate/Constructor.pm, avg 45µs/call | ||||
| 32 | 3 | 7µs | my ($self, $into, $me, $args) = @_; | ||
| 33 | my @builds = | ||||
| 34 | 9 | 32µs | 9 | 49µs | grep *{_getglob($_)}{CODE}, # spent 49µs making 9 calls to Moo::_Utils::_getglob, avg 5µs/call |
| 35 | map "${_}::BUILD", | ||||
| 36 | 3 | 37µs | 3 | 5µs | reverse @{_linear_isa($into)}; # spent 5µs making 3 calls to mro::get_linear_isa, avg 2µs/call |
| 37 | 3 | 16µs | ' (('.$args.')[0]->{__no_BUILD__} or ('."\n" | ||
| 38 | .join('', map qq{ ${me}->${_}(${args}),\n}, @builds) | ||||
| 39 | ." )),\n"; | ||||
| 40 | } | ||||
| 41 | |||||
| 42 | 1 | 3µs | 1; |