Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Method/Generate/BuildAll.pm |
Statements | Executed 30 statements in 391µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 66µs | 101µs | buildall_body_for | Method::Generate::BuildAll::
1 | 1 | 1 | 27µs | 30µs | BEGIN@2 | Method::Generate::BuildAll::
1 | 1 | 1 | 7µs | 38µs | BEGIN@3 | Method::Generate::BuildAll::
1 | 1 | 1 | 7µs | 7µs | BEGIN@6 | Method::Generate::BuildAll::
1 | 1 | 1 | 6µs | 37µs | BEGIN@7 | Method::Generate::BuildAll::
1 | 1 | 1 | 5µs | 18µs | BEGIN@8 | Method::Generate::BuildAll::
1 | 1 | 1 | 2µs | 2µs | BEGIN@5 | 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 | 2 | 30µs | 2 | 33µs | # spent 30µs (27+3) within Method::Generate::BuildAll::BEGIN@2 which was called:
# once (27µs+3µs) by Method::Generate::Constructor::buildall_generator at line 2 # spent 30µs making 1 call to Method::Generate::BuildAll::BEGIN@2
# spent 3µs making 1 call to strict::import |
3 | 2 | 15µs | 2 | 69µs | # spent 38µs (7+31) within Method::Generate::BuildAll::BEGIN@3 which was called:
# once (7µs+31µs) by Method::Generate::Constructor::buildall_generator at line 3 # spent 38µs making 1 call to Method::Generate::BuildAll::BEGIN@3
# spent 31µs making 1 call to warnings::import |
4 | |||||
5 | 2 | 23µs | 1 | 2µs | # spent 2µs within Method::Generate::BuildAll::BEGIN@5 which was called:
# once (2µs+0s) by Method::Generate::Constructor::buildall_generator at line 5 # spent 2µs making 1 call to Method::Generate::BuildAll::BEGIN@5 |
6 | 1 | 22µs | 1 | 7µs | # spent 7µs within Method::Generate::BuildAll::BEGIN@6 which was called:
# once (7µs+0s) by Method::Generate::Constructor::buildall_generator at line 6 # spent 7µs making 1 call to Method::Generate::BuildAll::BEGIN@6 |
7 | 2 | 19µs | 2 | 68µs | # spent 37µs (6+31) within Method::Generate::BuildAll::BEGIN@7 which was called:
# once (6µs+31µs) by Method::Generate::Constructor::buildall_generator at line 7 # spent 37µs making 1 call to Method::Generate::BuildAll::BEGIN@7
# spent 31µs making 1 call to Exporter::import |
8 | 2 | 210µs | 2 | 31µs | # spent 18µs (5+13) within Method::Generate::BuildAll::BEGIN@8 which was called:
# once (5µs+13µs) by Method::Generate::Constructor::buildall_generator at line 8 # spent 18µs making 1 call to Method::Generate::BuildAll::BEGIN@8
# spent 13µ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 101µs (66+35) within Method::Generate::BuildAll::buildall_body_for which was called 3 times, avg 34µs/call:
# 3 times (66µs+35µs) by Method::Generate::Constructor::generate_method at line 138 of Method/Generate/Constructor.pm, avg 34µs/call | ||||
32 | 3 | 3µs | my ($self, $into, $me, $args) = @_; | ||
33 | my @builds = | ||||
34 | 9 | 16µs | 9 | 31µs | grep *{_getglob($_)}{CODE}, # spent 31µs making 9 calls to Moo::_Utils::_getglob, avg 3µs/call |
35 | map "${_}::BUILD", | ||||
36 | 3 | 28µs | 3 | 4µs | reverse @{_linear_isa($into)}; # spent 4µs making 3 calls to mro::get_linear_isa, avg 1µs/call |
37 | 3 | 23µs | ' (('.$args.')[0]->{__no_BUILD__} or ('."\n" | ||
38 | .join('', map qq{ ${me}->${_}(${args}),\n}, @builds) | ||||
39 | ." )),\n"; | ||||
40 | } | ||||
41 | |||||
42 | 1 | 2µs | 1; |