← 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:34 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Method/Generate/Constructor.pm
StatementsExecuted 2498 statements in 6.65ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3111.09ms1.37msMethod::Generate::Constructor::::buildall_generatorMethod::Generate::Constructor::buildall_generator
6242945µs2.02msMethod::Generate::Constructor::::register_attribute_specsMethod::Generate::Constructor::register_attribute_specs
811756µs21.8msMethod::Generate::Constructor::::_assign_newMethod::Generate::Constructor::_assign_new
811517µs38.6msMethod::Generate::Constructor::::generate_methodMethod::Generate::Constructor::generate_method
7432433µs1.03msMethod::Generate::Constructor::::assert_constructorMethod::Generate::Constructor::assert_constructor
7411347µs594µsMethod::Generate::Constructor::::current_constructorMethod::Generate::Constructor::current_constructor
111270µs282µsMethod::Generate::Constructor::::BEGIN@10Method::Generate::Constructor::BEGIN@10
1011242µs2.58msMethod::Generate::Constructor::::install_delayedMethod::Generate::Constructor::install_delayed
811237µs313µsMethod::Generate::Constructor::::_check_requiredMethod::Generate::Constructor::_check_required
811195µs38.8msMethod::Generate::Constructor::::__ANON__[:101]Method::Generate::Constructor::__ANON__[:101]
5511170µs170µsMethod::Generate::Constructor::::_cap_callMethod::Generate::Constructor::_cap_call
81196µs230µsMethod::Generate::Constructor::::_handle_subconstructorMethod::Generate::Constructor::_handle_subconstructor
763176µs76µsMethod::Generate::Constructor::::accessor_generatorMethod::Generate::Constructor::accessor_generator
631156µs56µsMethod::Generate::Constructor::::CORE:substMethod::Generate::Constructor::CORE:subst (opcode)
71155µs78µsMethod::Generate::Constructor::::_build_construction_stringMethod::Generate::Constructor::_build_construction_string
92242µs120µsMethod::Generate::Constructor::::construction_stringMethod::Generate::Constructor::construction_string
243132µs32µsMethod::Generate::Constructor::::CORE:sortMethod::Generate::Constructor::CORE:sort (opcode)
11126µs29µsMethod::Generate::Constructor::::BEGIN@2Method::Generate::Constructor::BEGIN@2
61117µs17µsMethod::Generate::Constructor::::_generate_argsMethod::Generate::Constructor::_generate_args
1116µs265µsMethod::Generate::Constructor::::BEGIN@12Method::Generate::Constructor::BEGIN@12
1116µs32µsMethod::Generate::Constructor::::BEGIN@3Method::Generate::Constructor::BEGIN@3
1116µs21µsMethod::Generate::Constructor::::BEGIN@8Method::Generate::Constructor::BEGIN@8
1114µs4µsMethod::Generate::Constructor::::BEGIN@11Method::Generate::Constructor::BEGIN@11
1114µs19µsMethod::Generate::Constructor::::BEGIN@6Method::Generate::Constructor::BEGIN@6
1114µs21µsMethod::Generate::Constructor::::BEGIN@7Method::Generate::Constructor::BEGIN@7
1113µs25µsMethod::Generate::Constructor::::BEGIN@5Method::Generate::Constructor::BEGIN@5
1113µs21µsMethod::Generate::Constructor::::BEGIN@9Method::Generate::Constructor::BEGIN@9
3213µs3µsMethod::Generate::Constructor::::all_attribute_specsMethod::Generate::Constructor::all_attribute_specs
2112µs2µsMethod::Generate::Constructor::::_generate_args_via_buildargsMethod::Generate::Constructor::_generate_args_via_buildargs
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::Constructor;
2228µs232µs
# spent 29µs (26+3) within Method::Generate::Constructor::BEGIN@2 which was called: # once (26µs+3µs) by Moo::_constructor_maker_for at line 2
use strict;
# spent 29µs making 1 call to Method::Generate::Constructor::BEGIN@2 # spent 3µs making 1 call to strict::import
3217µs258µs
# spent 32µs (6+26) within Method::Generate::Constructor::BEGIN@3 which was called: # once (6µs+26µs) by Moo::_constructor_maker_for at line 3
use warnings;
# spent 32µs making 1 call to Method::Generate::Constructor::BEGIN@3 # spent 26µs making 1 call to warnings::import
4
5217µs247µs
# spent 25µs (3+22) within Method::Generate::Constructor::BEGIN@5 which was called: # once (3µs+22µs) by Moo::_constructor_maker_for at line 5
use Sub::Quote qw(quote_sub quotify);
# spent 25µs making 1 call to Method::Generate::Constructor::BEGIN@5 # spent 22µs making 1 call to Exporter::import
6213µs234µs
# spent 19µs (4+15) within Method::Generate::Constructor::BEGIN@6 which was called: # once (4µs+15µs) by Moo::_constructor_maker_for at line 6
use Sub::Defer;
# spent 19µs making 1 call to Method::Generate::Constructor::BEGIN@6 # spent 15µs making 1 call to Exporter::import
7215µs238µs
# spent 21µs (4+17) within Method::Generate::Constructor::BEGIN@7 which was called: # once (4µs+17µs) by Moo::_constructor_maker_for at line 7
use Moo::_Utils qw(_getstash _getglob _linear_isa);
# spent 21µs making 1 call to Method::Generate::Constructor::BEGIN@7 # spent 17µs making 1 call to Exporter::import
8213µs236µs
# spent 21µs (6+15) within Method::Generate::Constructor::BEGIN@8 which was called: # once (6µs+15µs) by Moo::_constructor_maker_for at line 8
use Scalar::Util qw(weaken);
# spent 21µs making 1 call to Method::Generate::Constructor::BEGIN@8 # spent 15µs making 1 call to Exporter::import
9212µs239µs
# spent 21µs (3+18) within Method::Generate::Constructor::BEGIN@9 which was called: # once (3µs+18µs) by Moo::_constructor_maker_for at line 9
use Carp qw(croak);
# spent 21µs making 1 call to Method::Generate::Constructor::BEGIN@9 # spent 18µs making 1 call to Exporter::import
102188µs1282µs
# spent 282µs (270+12) within Method::Generate::Constructor::BEGIN@10 which was called: # once (270µs+12µs) by Moo::_constructor_maker_for at line 10
use Carp::Heavy ();
# spent 282µs making 1 call to Method::Generate::Constructor::BEGIN@10
11129µs14µs
# spent 4µs within Method::Generate::Constructor::BEGIN@11 which was called: # once (4µs+0s) by Moo::_constructor_maker_for at line 11
BEGIN { our @CARP_NOT = qw(Sub::Defer) }
# spent 4µs making 1 call to Method::Generate::Constructor::BEGIN@11
12
# spent 265µs (6+259) within Method::Generate::Constructor::BEGIN@12 which was called: # once (6µs+259µs) by Moo::_constructor_maker_for at line 16
BEGIN {
1310s local $Moo::sification::disabled = 1;
1411µs require Moo;
1514µs1259µs Moo->import;
# spent 259µs making 1 call to Moo::import
1611.25ms1265µs}
# spent 265µs making 1 call to Method::Generate::Constructor::BEGIN@12
17
18
# spent 2.02ms (945µs+1.08) within Method::Generate::Constructor::register_attribute_specs which was called 62 times, avg 33µs/call: # 49 times (797µs+942µs) by Moo::has at line 119 of Moo.pm, avg 35µs/call # 10 times (127µs+121µs) by Moo::_constructor_maker_for at line 262 of Moo.pm, avg 25µs/call # 2 times (3µs+11µs) by Moo::_set_superclasses at line 158 of Moo.pm, avg 7µs/call # once (18µs+4µs) by Moo::_constructor_maker_for at line 250
sub register_attribute_specs {
196252µs my ($self, @new_specs) = @_;
2062102µs62841µs $self->assert_constructor;
# spent 841µs making 62 calls to Method::Generate::Constructor::assert_constructor, avg 14µs/call
216239µs my $specs = $self->{attribute_specs}||={};
226273µs6263µs my $ag = $self->accessor_generator;
# spent 63µs making 62 calls to Method::Generate::Constructor::accessor_generator, avg 1µs/call
2362136µs while (my ($name, $new_spec) = splice @new_specs, 0, 2) {
2463147µs6356µs if ($name =~ s/^\+//) {
# spent 56µs making 63 calls to Method::Generate::Constructor::CORE:subst, avg 889ns/call
25 croak "has '+${name}' given but no ${name} attribute already exists"
2621µs unless my $old_spec = $specs->{$name};
27268µs279µs $ag->merge_specs($new_spec, $old_spec);
# spent 79µs making 2 calls to Method::Generate::Accessor::merge_specs, avg 40µs/call
28 }
296371µs1339µs if ($new_spec->{required}
# spent 39µs making 13 calls to Method::Generate::Accessor::has_default, avg 3µs/call
30 && !(
31 $ag->has_default($name, $new_spec)
32 || !exists $new_spec->{init_arg}
33 || defined $new_spec->{init_arg}
34 )
35 ) {
36 croak "You cannot have a required attribute (${name})"
37 . " without a default, builder, or an init_arg";
38 }
39 $new_spec->{index} = scalar keys %$specs
406375µs unless defined $new_spec->{index};
416364µs $specs->{$name} = $new_spec;
42 }
4362147µs $self;
44}
45
46
# spent 3µs within Method::Generate::Constructor::all_attribute_specs which was called 3 times, avg 1µs/call: # 2 times (2µs+0s) by Moo::_set_superclasses at line 158 of Moo.pm, avg 1µs/call # once (1µs+0s) by Moo::_constructor_maker_for at line 262 of Moo.pm
sub all_attribute_specs {
47 $_[0]->{attribute_specs}
48345µs}
49
50
# spent 76µs within Method::Generate::Constructor::accessor_generator which was called 76 times, avg 1µs/call: # 62 times (63µs+0s) by Method::Generate::Constructor::register_attribute_specs at line 22, avg 1µs/call # 8 times (4µs+0s) by Method::Generate::Constructor::_assign_new at line 209, avg 500ns/call # 6 times (9µs+0s) by Method::Generate::Constructor::_build_construction_string at line 68, avg 2µs/call
sub accessor_generator {
51 $_[0]->{accessor_generator}
5276141µs}
53
54
# spent 120µs (42+78) within Method::Generate::Constructor::construction_string which was called 9 times, avg 13µs/call: # 8 times (37µs+65µs) by Method::Generate::Constructor::generate_method at line 138, avg 13µs/call # once (5µs+13µs) by Moo::_constructor_maker_for at line 237 of Moo.pm
sub construction_string {
5594µs my ($self) = @_;
56 $self->{construction_string}
57931µs778µs ||= $self->_build_construction_string;
# spent 78µs making 7 calls to Method::Generate::Constructor::_build_construction_string, avg 11µs/call
58}
59
60
# spent 1.37ms (1.09+274µs) within Method::Generate::Constructor::buildall_generator which was called 3 times, avg 456µs/call: # 3 times (1.09ms+274µs) by Method::Generate::Constructor::generate_method at line 138, avg 456µs/call
sub buildall_generator {
613638µs require Method::Generate::BuildAll;
62333µs368µs Method::Generate::BuildAll->new;
# spent 68µs making 3 calls to Moo::Object::new, avg 23µs/call
63}
64
65
# spent 78µs (55+23) within Method::Generate::Constructor::_build_construction_string which was called 7 times, avg 11µs/call: # 7 times (55µs+23µs) by Method::Generate::Constructor::construction_string at line 57, avg 11µs/call
sub _build_construction_string {
6671µs my ($self) = @_;
6773µs my $builder = $self->{construction_builder};
68745µs1323µs $builder ? $self->$builder
# spent 9µs making 6 calls to Method::Generate::Constructor::accessor_generator, avg 2µs/call # spent 8µs making 1 call to Moo::__ANON__[Moo.pm:256] # spent 6µs making 6 calls to Method::Generate::Accessor::default_construction_string, avg 1µs/call
69 : 'bless('
70 .$self->accessor_generator->default_construction_string
71 .', $class);'
72}
73
74
# spent 2.58ms (242µs+2.34) within Method::Generate::Constructor::install_delayed which was called 10 times, avg 258µs/call: # 10 times (242µs+2.34ms) by Moo::_constructor_maker_for at line 262 of Moo.pm, avg 258µs/call
sub install_delayed {
75106µs my ($self) = @_;
761034µs10172µs $self->assert_constructor;
# spent 172µs making 10 calls to Method::Generate::Constructor::assert_constructor, avg 17µs/call
77107µs my $package = $self->{package};
781042µs109µs my (undef, @isa) = @{_linear_isa($package)};
# spent 9µs making 10 calls to mro::get_linear_isa, avg 900ns/call
791012µs my $isa = join ',', @isa;
801053µs101.65ms my (undef, $from_file, $from_line) = caller(Carp::short_error_loc());
# spent 1.65ms making 10 calls to Carp::short_error_loc, avg 165µs/call
81
# spent 38.8ms (195µs+38.6) within Method::Generate::Constructor::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Method/Generate/Constructor.pm:101] which was called 8 times, avg 4.85ms/call: # 8 times (195µs+38.6ms) by Sub::Defer::undefer_sub at line 85 of Sub/Defer.pm, avg 4.85ms/call
my $constructor = defer_sub "${package}::new" => sub {
82865µs825µs my (undef, @new_isa) = @{_linear_isa($package)};
# spent 25µs making 8 calls to mro::get_linear_isa, avg 3µs/call
83816µs if (join(',', @new_isa) ne $isa) {
84 my ($expected_new) = grep { *{_getglob($_.'::new')}{CODE} } @isa;
85 my ($found_new) = grep { *{_getglob($_.'::new')}{CODE} } @new_isa;
86 if (($found_new||'') ne ($expected_new||'')) {
87 $found_new ||= 'none';
88 $expected_new ||= 'none';
89 croak "Expected parent constructor of $package to be"
90 . " $expected_new, but found $found_new: changing the inheritance"
91 . " chain (\@ISA) at runtime (after $from_file line $from_line) is unsupported";
92 }
93 }
94
95 my $constructor = $self->generate_method(
96852µs838.6ms $package, 'new', $self->{attribute_specs}, { no_install => 1, no_defer => 1 }
# spent 38.6ms making 8 calls to Method::Generate::Constructor::generate_method, avg 4.82ms/call
97 );
98811µs $self->{inlined} = 1;
99834µs810µs weaken($self->{constructor} = $constructor);
# spent 10µs making 8 calls to Scalar::Util::weaken, avg 1µs/call
100829µs $constructor;
1011058µs10494µs };
# spent 494µs making 10 calls to Sub::Defer::defer_sub, avg 49µs/call
102109µs $self->{inlined} = 0;
1031024µs107µs weaken($self->{constructor} = $constructor);
# spent 7µs making 10 calls to Scalar::Util::weaken, avg 700ns/call
1041018µs $self;
105}
106
107
# spent 594µs (347+247) within Method::Generate::Constructor::current_constructor which was called 74 times, avg 8µs/call: # 74 times (347µs+247µs) by Method::Generate::Constructor::assert_constructor at line 115, avg 8µs/call
sub current_constructor {
1087438µs my ($self, $package) = @_;
10974284µs74247µs return *{_getglob("${package}::new")}{CODE};
# spent 247µs making 74 calls to Moo::_Utils::_getglob, avg 3µs/call
110}
111
112
# spent 1.03ms (433µs+594µs) within Method::Generate::Constructor::assert_constructor which was called 74 times, avg 14µs/call: # 62 times (363µs+478µs) by Method::Generate::Constructor::register_attribute_specs at line 20, avg 14µs/call # 10 times (61µs+111µs) by Method::Generate::Constructor::install_delayed at line 76, avg 17µs/call # 2 times (9µs+5µs) by Moo::_set_superclasses at line 155 of Moo.pm, avg 7µs/call
sub assert_constructor {
1137427µs my ($self) = @_;
1147452µs my $package = $self->{package} or return 1;
11574153µs74594µs my $current = $self->current_constructor($package)
# spent 594µs making 74 calls to Method::Generate::Constructor::current_constructor, avg 8µs/call
116 or return 1;
117 my $constructor = $self->{constructor}
1186426µs or croak "Unknown constructor for $package already exists";
1196444µs croak "Constructor for $package has been replaced with an unknown sub"
120 if $constructor != $current;
121 croak "Constructor for $package has been inlined and cannot be updated"
12264117µs if $self->{inlined};
123}
124
125
# spent 38.6ms (517µs+38.1) within Method::Generate::Constructor::generate_method which was called 8 times, avg 4.82ms/call: # 8 times (517µs+38.1ms) by Method::Generate::Constructor::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/Method/Generate/Constructor.pm:101] at line 96, avg 4.82ms/call
sub generate_method {
12684µs my ($self, $into, $name, $spec, $quote_opts) = @_;
127 $quote_opts = {
128819µs %{$quote_opts||{}},
129 package => $into,
130 };
131870µs foreach my $no_init (grep !exists($spec->{$_}{init_arg}), keys %$spec) {
1325151µs $spec->{$no_init}{init_arg} = $no_init;
133 }
134816µs local $self->{captures} = {};
135
136875µs835µs my $into_buildargs = $into->can('BUILDARGS');
# spent 35µs making 8 calls to UNIVERSAL::can, avg 4µs/call
137
1388339µs5424.1ms my $body
# spent 21.8ms making 8 calls to Method::Generate::Constructor::_assign_new, avg 2.73ms/call # spent 1.37ms making 3 calls to Method::Generate::Constructor::buildall_generator, avg 456µs/call # spent 313µs making 8 calls to Method::Generate::Constructor::_check_required, avg 39µs/call # spent 230µs making 8 calls to Method::Generate::Constructor::_handle_subconstructor, avg 29µs/call # spent 141µs making 3 calls to Method::Generate::BuildAll::buildall_body_for, avg 47µs/call # spent 102µs making 8 calls to Method::Generate::Constructor::construction_string, avg 13µs/call # spent 98µs making 8 calls to UNIVERSAL::can, avg 12µs/call # spent 17µs making 6 calls to Method::Generate::Constructor::_generate_args, avg 3µs/call # spent 2µs making 2 calls to Method::Generate::Constructor::_generate_args_via_buildargs, avg 1µs/call
139 = ' my $invoker = CORE::shift();'."\n"
140 . ' my $class = CORE::ref($invoker) ? CORE::ref($invoker) : $invoker;'."\n"
141 . $self->_handle_subconstructor($into, $name)
142 . ( $into_buildargs && $into_buildargs != \&Moo::Object::BUILDARGS
143 ? $self->_generate_args_via_buildargs
144 : $self->_generate_args
145 )
146 . $self->_check_required($spec)
147 . ' my $new = '.$self->construction_string.";\n"
148 . $self->_assign_new($spec)
149 . ( $into->can('BUILD')
150 ? $self->buildall_generator->buildall_body_for( $into, '$new', '$args' )
151 : ''
152 )
153 . ' return $new;'."\n";
154
155847µs829µs if ($into->can('DEMOLISH')) {
# spent 29µs making 8 calls to UNIVERSAL::can, avg 4µs/call
156 require Method::Generate::DemolishAll;
157 Method::Generate::DemolishAll->new->generate_method($into);
158 }
159 quote_sub
160 "${into}::${name}" => $body,
161891µs813.9ms $self->{captures}, $quote_opts||{}
# spent 13.9ms making 8 calls to Sub::Quote::quote_sub, avg 1.74ms/call
162 ;
163}
164
165
# spent 230µs (96+134) within Method::Generate::Constructor::_handle_subconstructor which was called 8 times, avg 29µs/call: # 8 times (96µs+134µs) by Method::Generate::Constructor::generate_method at line 138, avg 29µs/call
sub _handle_subconstructor {
16683µs my ($self, $into, $name) = @_;
167865µs8134µs if (my $gen = $self->{subconstructor_handler}) {
# spent 134µs making 8 calls to Sub::Quote::quotify, avg 17µs/call
168 ' if ($class ne '.quotify($into).') {'."\n".
169 $gen.
170 ' }'."\n";
171 } else {
172 ''
173 }
174}
175
176
# spent 170µs within Method::Generate::Constructor::_cap_call which was called 55 times, avg 3µs/call: # 55 times (170µs+0s) by Method::Generate::Constructor::_assign_new at line 223, avg 3µs/call
sub _cap_call {
1775513µs my ($self, $code, $captures) = @_;
17855109µs @{$self->{captures}}{keys %$captures} = values %$captures if $captures;
1795583µs $code;
180}
181
182
# spent 2µs within Method::Generate::Constructor::_generate_args_via_buildargs which was called 2 times, avg 1µs/call: # 2 times (2µs+0s) by Method::Generate::Constructor::generate_method at line 138, avg 1µs/call
sub _generate_args_via_buildargs {
18320s my ($self) = @_;
18424µs q{ my $args = $class->BUILDARGS(@_);}."\n"
185 .q{ Carp::croak("BUILDARGS did not return a hashref") unless CORE::ref($args) eq 'HASH';}
186 ."\n";
187}
188
189# inlined from Moo::Object - update that first.
190
# spent 17µs within Method::Generate::Constructor::_generate_args which was called 6 times, avg 3µs/call: # 6 times (17µs+0s) by Method::Generate::Constructor::generate_method at line 138, avg 3µs/call
sub _generate_args {
19164µs my ($self) = @_;
192611µs return <<'_EOA';
193 my $args = scalar @_ == 1
194 ? CORE::ref $_[0] eq 'HASH'
195 ? { %{ $_[0] } }
196 : Carp::croak("Single parameters to new() must be a HASH ref"
197 . " data => ". $_[0])
198 : @_ % 2
199 ? Carp::croak("The new() method for $class expects a hash reference or a"
200 . " key/value list. You passed an odd number of arguments")
201 : {@_}
202 ;
203_EOA
204
205}
206
207
# spent 21.8ms (756µs+21.1) within Method::Generate::Constructor::_assign_new which was called 8 times, avg 2.73ms/call: # 8 times (756µs+21.1ms) by Method::Generate::Constructor::generate_method at line 138, avg 2.73ms/call
sub _assign_new {
20883µs my ($self, $spec) = @_;
20989µs84µs my $ag = $self->accessor_generator;
# spent 4µs making 8 calls to Method::Generate::Constructor::accessor_generator, avg 500ns/call
21082µs my %test;
211827µs86µs NAME: foreach my $name (sort keys %$spec) {
# spent 6µs making 8 calls to Method::Generate::Constructor::CORE:sort, avg 750ns/call
2126122µs my $attr_spec = $spec->{$name};
213 next NAME unless defined($attr_spec->{init_arg})
2146129µs68µs or $ag->has_eager_default($name, $attr_spec);
# spent 8µs making 6 calls to Method::Generate::Accessor::has_eager_default, avg 1µs/call
2155547µs $test{$name} = $attr_spec->{init_arg};
216 }
217 join '', map {
21863230µs86µs my $arg = $test{$_};
# spent 6µs making 8 calls to Method::Generate::Constructor::CORE:sort, avg 750ns/call
2195570µs55257µs my $arg_key = quotify($arg);
# spent 257µs making 55 calls to Sub::Quote::quotify, avg 5µs/call
2205524µs my $test = defined $arg ? "exists \$args->{$arg_key}" : undef;
2215510µs my $source = defined $arg ? "\$args->{$arg_key}" : undef;
2225528µs my $attr_spec = $spec->{$_};
22355156µs11020.8ms $self->_cap_call($ag->generate_populate_set(
# spent 20.6ms making 55 calls to Method::Generate::Accessor::generate_populate_set, avg 375µs/call # spent 170µs making 55 calls to Method::Generate::Constructor::_cap_call, avg 3µs/call
224 '$new', $_, $attr_spec, $source, $test, $arg,
225 ));
226 } sort keys %test;
227}
228
229
# spent 313µs (237+76) within Method::Generate::Constructor::_check_required which was called 8 times, avg 39µs/call: # 8 times (237µs+76µs) by Method::Generate::Constructor::generate_method at line 138, avg 39µs/call
sub _check_required {
23084µs my ($self, $spec) = @_;
231 my @required_init =
232 map $spec->{$_}{init_arg},
233 grep {
23469132µs820µs my $s = $spec->{$_}; # ignore required if default or builder set
# spent 20µs making 8 calls to Method::Generate::Constructor::CORE:sort, avg 2µs/call
235 $s->{required} and not($s->{builder} or exists $s->{default})
2366144µs } sort keys %$spec;
237836µs return '' unless @required_init;
238529µs1356µs ' if (my @missing = grep !exists $args->{$_}, '
# spent 56µs making 13 calls to Sub::Quote::quotify, avg 4µs/call
239 .join(', ', map quotify($_), @required_init).') {'."\n"
240 .q{ Carp::croak("Missing required arguments: ".CORE::join(', ', sort @missing));}."\n"
241 ." }\n";
242}
243
244# bootstrap our own constructor
245sub new {
24610s my $class = shift;
24714µs13µs delete _getstash(__PACKAGE__)->{new};
# spent 3µs making 1 call to Moo::_Utils::_getstash
248110µs11µs bless $class->BUILDARGS(@_), $class;
# spent 1µs making 1 call to Moo::Object::BUILDARGS
249}
250112µs222µsMoo->_constructor_maker_for(__PACKAGE__)
# spent 22µs making 1 call to Method::Generate::Constructor::register_attribute_specs # spent 338µs making 1 call to Moo::_constructor_maker_for, recursion: max depth 1, sum of overlapping time 338µs
251->register_attribute_specs(
252 attribute_specs => {
253 is => 'ro',
254 reader => 'all_attribute_specs',
255 },
256 accessor_generator => { is => 'ro' },
257 construction_string => { is => 'lazy' },
258 construction_builder => { is => 'bare' },
259 subconstructor_handler => { is => 'ro' },
260 package => { is => 'bare' },
261);
26210sif ($INC{'Moo/HandleMoose.pm'} && !$Moo::sification::disabled) {
263 Moo::HandleMoose::inject_fake_metaclass_for(__PACKAGE__);
264}
265
26617µs1;
 
# spent 32µs within Method::Generate::Constructor::CORE:sort which was called 24 times, avg 1µs/call: # 8 times (20µs+0s) by Method::Generate::Constructor::_check_required at line 234, avg 2µs/call # 8 times (6µs+0s) by Method::Generate::Constructor::_assign_new at line 218, avg 750ns/call # 8 times (6µs+0s) by Method::Generate::Constructor::_assign_new at line 211, avg 750ns/call
sub Method::Generate::Constructor::CORE:sort; # opcode
# spent 56µs within Method::Generate::Constructor::CORE:subst which was called 63 times, avg 889ns/call: # 63 times (56µs+0s) by Method::Generate::Constructor::register_attribute_specs at line 24, avg 889ns/call
sub Method::Generate::Constructor::CORE:subst; # opcode