| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Method/Generate/BuildAll.pm |
| Statements | Executed 20 statements in 316µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 2 | 1 | 1 | 22µs | 27µs | Method::Generate::BuildAll::buildall_body_for |
| 1 | 1 | 1 | 10µs | 25µs | Method::Generate::BuildAll::BEGIN@3 |
| 1 | 1 | 1 | 6µs | 31µs | Method::Generate::BuildAll::BEGIN@6 |
| 1 | 1 | 1 | 6µs | 46µs | Method::Generate::BuildAll::BEGIN@7 |
| 1 | 1 | 1 | 2µs | 2µs | Method::Generate::BuildAll::BEGIN@4 |
| 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 | |||||
| 3 | 2 | 20µs | 2 | 40µs | # spent 25µs (10+15) within Method::Generate::BuildAll::BEGIN@3 which was called:
# once (10µs+15µs) by Method::Generate::Constructor::buildall_generator at line 3 # spent 25µs making 1 call to Method::Generate::BuildAll::BEGIN@3
# spent 15µs making 1 call to Moo::_strictures::import |
| 4 | 2 | 23µs | 1 | 2µs | # spent 2µs within Method::Generate::BuildAll::BEGIN@4 which was called:
# once (2µs+0s) by Method::Generate::Constructor::buildall_generator at line 4 # spent 2µs making 1 call to Method::Generate::BuildAll::BEGIN@4 |
| 5 | 1 | 4µs | our @ISA = qw(Moo::Object); | ||
| 6 | 2 | 20µs | 2 | 57µs | # spent 31µs (6+26) within Method::Generate::BuildAll::BEGIN@6 which was called:
# once (6µs+26µs) by Method::Generate::Constructor::buildall_generator at line 6 # spent 31µs making 1 call to Method::Generate::BuildAll::BEGIN@6
# spent 26µs making 1 call to Exporter::import |
| 7 | 2 | 215µs | 2 | 86µs | # spent 46µs (6+40) within Method::Generate::BuildAll::BEGIN@7 which was called:
# once (6µs+40µs) by Method::Generate::Constructor::buildall_generator at line 7 # spent 46µs making 1 call to Method::Generate::BuildAll::BEGIN@7
# spent 40µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | sub generate_method { | ||||
| 10 | my ($self, $into) = @_; | ||||
| 11 | quote_sub "${into}::BUILDALL", join '', | ||||
| 12 | $self->_handle_subbuild($into), | ||||
| 13 | qq{ my \$self = shift;\n}, | ||||
| 14 | $self->buildall_body_for($into, '$self', '@_'), | ||||
| 15 | qq{ return \$self\n}; | ||||
| 16 | } | ||||
| 17 | |||||
| 18 | sub _handle_subbuild { | ||||
| 19 | my ($self, $into) = @_; | ||||
| 20 | ' if (ref($_[0]) ne '.quotify($into).') {'."\n". | ||||
| 21 | ' return shift->Moo::Object::BUILDALL(@_)'.";\n". | ||||
| 22 | ' }'."\n"; | ||||
| 23 | } | ||||
| 24 | |||||
| 25 | # spent 27µs (22+6) within Method::Generate::BuildAll::buildall_body_for which was called 2 times, avg 14µs/call:
# 2 times (22µs+6µs) by Method::Generate::Constructor::generate_method at line 140 of Method/Generate/Constructor.pm, avg 14µs/call | ||||
| 26 | 2 | 1µs | my ($self, $into, $me, $args) = @_; | ||
| 27 | my @builds = | ||||
| 28 | 4 | 2µs | 4 | 5µs | grep *{_getglob($_)}{CODE}, # spent 5µs making 4 calls to Moo::_Utils::_getglob, avg 1µs/call |
| 29 | map "${_}::BUILD", | ||||
| 30 | 2 | 10µs | 2 | 1µs | reverse @{mro::get_linear_isa($into)}; # spent 1µs making 2 calls to mro::get_linear_isa, avg 500ns/call |
| 31 | 2 | 18µs | ' unless (('.$args.')[0]->{__no_BUILD__}) {'."\n" | ||
| 32 | .join('', map qq{ ${me}->${_}(${args});\n}, @builds) | ||||
| 33 | ." }\n"; | ||||
| 34 | } | ||||
| 35 | |||||
| 36 | 1 | 2µs | 1; |