Filename | /usr/share/perl5/Method/Generate/BuildAll.pm |
Statements | Executed 22 statements in 420µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 32µs | 62µs | buildall_body_for | Method::Generate::BuildAll::
1 | 1 | 1 | 20µs | 74µs | BEGIN@3 | Method::Generate::BuildAll::
1 | 1 | 1 | 11µs | 48µs | BEGIN@5 | Method::Generate::BuildAll::
1 | 1 | 1 | 11µs | 78µs | BEGIN@6 | Method::Generate::BuildAll::
1 | 1 | 1 | 10µs | 34µs | BEGIN@7 | Method::Generate::BuildAll::
1 | 1 | 1 | 8µs | 78µs | BEGIN@4 | Method::Generate::BuildAll::
0 | 0 | 0 | 0s | 0s | _handle_subbuild | Method::Generate::BuildAll::
0 | 0 | 0 | 0s | 0s | generate_method | Method::Generate::BuildAll::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Method::Generate::BuildAll; | ||||
2 | |||||
3 | 3 | 43µs | 3 | 127µs | # spent 74µs (20+54) within Method::Generate::BuildAll::BEGIN@3 which was called:
# once (20µs+54µs) by Method::Generate::Constructor::buildall_generator at line 3 # spent 74µs making 1 call to Method::Generate::BuildAll::BEGIN@3
# spent 36µs making 1 call to strictures::import
# spent 17µs making 1 call to strictures::VERSION |
4 | 2 | 34µs | 2 | 147µs | # spent 78µs (8+70) within Method::Generate::BuildAll::BEGIN@4 which was called:
# once (8µs+70µs) by Method::Generate::Constructor::buildall_generator at line 4 # spent 78µs making 1 call to Method::Generate::BuildAll::BEGIN@4
# spent 70µs making 1 call to base::import |
5 | 2 | 32µs | 2 | 85µs | # spent 48µs (11+37) within Method::Generate::BuildAll::BEGIN@5 which was called:
# once (11µs+37µs) by Method::Generate::Constructor::buildall_generator at line 5 # spent 48µs making 1 call to Method::Generate::BuildAll::BEGIN@5
# spent 37µs making 1 call to Exporter::import |
6 | 2 | 33µs | 2 | 145µs | # spent 78µs (11+67) within Method::Generate::BuildAll::BEGIN@6 which was called:
# once (11µs+67µs) by Method::Generate::Constructor::buildall_generator at line 6 # spent 78µs making 1 call to Method::Generate::BuildAll::BEGIN@6
# spent 67µs making 1 call to Exporter::import |
7 | 2 | 245µs | 2 | 58µs | # spent 34µs (10+24) within Method::Generate::BuildAll::BEGIN@7 which was called:
# once (10µs+24µs) by Method::Generate::Constructor::buildall_generator at line 7 # spent 34µs making 1 call to Method::Generate::BuildAll::BEGIN@7
# spent 24µ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 '.perlstring($into).') {'."\n". | ||||
21 | ' return shift->Moo::Object::BUILDALL(@_)'.";\n". | ||||
22 | ' }'."\n"; | ||||
23 | } | ||||
24 | |||||
25 | # spent 62µs (32+30) within Method::Generate::BuildAll::buildall_body_for which was called 2 times, avg 31µs/call:
# 2 times (32µs+30µs) by Method::Generate::Constructor::generate_method at line 98 of Method/Generate/Constructor.pm, avg 31µs/call | ||||
26 | 2 | 2µs | my ($self, $into, $me, $args) = @_; | ||
27 | 4 | 4µs | 4 | 8µs | my @builds = # spent 8µs making 4 calls to Moo::_Utils::_getglob, avg 2µs/call |
28 | grep *{_getglob($_)}{CODE}, | ||||
29 | map "${_}::BUILD", | ||||
30 | 2 | 12µs | 2 | 22µs | reverse @{Moo::_Utils::_get_linear_isa($into)}; # spent 22µs making 2 calls to Moo::_Utils::_get_linear_isa, avg 11µs/call |
31 | 2 | 12µs | join '', map qq{ ${me}->${_}(${args});\n}, @builds; | ||
32 | } | ||||
33 | |||||
34 | 1 | 2µs | 1; |