← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:57:08 2022
Reported on Wed Dec 14 16:00:37 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Method/Generate/BuildAll.pm
StatementsExecuted 30 statements in 610µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
31194µs141µsMethod::Generate::BuildAll::::buildall_body_forMethod::Generate::BuildAll::buildall_body_for
11145µs51µsMethod::Generate::BuildAll::::BEGIN@2Method::Generate::BuildAll::BEGIN@2
11111µs11µsMethod::Generate::BuildAll::::BEGIN@6Method::Generate::BuildAll::BEGIN@6
11110µs54µsMethod::Generate::BuildAll::::BEGIN@7Method::Generate::BuildAll::BEGIN@7
11110µs33µsMethod::Generate::BuildAll::::BEGIN@8Method::Generate::BuildAll::BEGIN@8
1118µs54µsMethod::Generate::BuildAll::::BEGIN@3Method::Generate::BuildAll::BEGIN@3
1113µs3µsMethod::Generate::BuildAll::::BEGIN@5Method::Generate::BuildAll::BEGIN@5
0000s0sMethod::Generate::BuildAll::::_handle_subbuildMethod::Generate::BuildAll::_handle_subbuild
0000s0sMethod::Generate::BuildAll::::generate_methodMethod::Generate::BuildAll::generate_method
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Method::Generate::BuildAll;
2246µs257µs
# spent 51µs (45+6) within Method::Generate::BuildAll::BEGIN@2 which was called: # once (45µs+6µs) by Method::Generate::Constructor::buildall_generator at line 2
use strict;
# spent 51µs making 1 call to Method::Generate::BuildAll::BEGIN@2 # spent 6µs making 1 call to strict::import
3228µs2100µs
# spent 54µs (8+46) within Method::Generate::BuildAll::BEGIN@3 which was called: # once (8µs+46µs) by Method::Generate::Constructor::buildall_generator at line 3
use warnings;
# spent 54µs making 1 call to Method::Generate::BuildAll::BEGIN@3 # spent 46µs making 1 call to warnings::import
4
5238µs13µs
# spent 3µs within Method::Generate::BuildAll::BEGIN@5 which was called: # once (3µs+0s) by Method::Generate::Constructor::buildall_generator at line 5
use Moo::Object ();
# spent 3µs making 1 call to Method::Generate::BuildAll::BEGIN@5
6132µs111µs
# spent 11µs within Method::Generate::BuildAll::BEGIN@6 which was called: # once (11µs+0s) by Method::Generate::Constructor::buildall_generator at line 6
BEGIN { our @ISA = qw(Moo::Object) }
# spent 11µs making 1 call to Method::Generate::BuildAll::BEGIN@6
7232µs298µs
# spent 54µs (10+44) within Method::Generate::BuildAll::BEGIN@7 which was called: # once (10µs+44µs) by Method::Generate::Constructor::buildall_generator at line 7
use Sub::Quote qw(quote_sub quotify);
# spent 54µs making 1 call to Method::Generate::BuildAll::BEGIN@7 # spent 44µs making 1 call to Exporter::import
82335µs256µs
# spent 33µs (10+23) within Method::Generate::BuildAll::BEGIN@8 which was called: # once (10µs+23µs) by Method::Generate::Constructor::buildall_generator at line 8
use Moo::_Utils qw(_getglob _linear_isa);
# spent 33µs making 1 call to Method::Generate::BuildAll::BEGIN@8 # spent 23µs making 1 call to Exporter::import
9
10sub 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
24sub _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 141µs (94+47) within Method::Generate::BuildAll::buildall_body_for which was called 3 times, avg 47µs/call: # 3 times (94µs+47µs) by Method::Generate::Constructor::generate_method at line 138 of Method/Generate/Constructor.pm, avg 47µs/call
sub buildall_body_for {
3234µs my ($self, $into, $me, $args) = @_;
33 my @builds =
3498µs936µs grep *{_getglob($_)}{CODE},
# spent 36µs making 9 calls to Moo::_Utils::_getglob, avg 4µs/call
35 map "${_}::BUILD",
36363µs311µs reverse @{_linear_isa($into)};
# spent 11µs making 3 calls to mro::get_linear_isa, avg 4µs/call
37320µs ' (('.$args.')[0]->{__no_BUILD__} or ('."\n"
38 .join('', map qq{ ${me}->${_}(${args}),\n}, @builds)
39 ." )),\n";
40}
41
4214µs1;