← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:33:55 2022
Reported on Wed Dec 14 15:40:04 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Schema.pm
StatementsExecuted 575164 statements in 638ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2094111403ms608msYAML::PP::Schema::::load_scalarYAML::PP::Schema::load_scalar
709991185.3ms85.3msYAML::PP::Schema::::CORE:regcompYAML::PP::Schema::CORE:regcomp (opcode)
710013180.2ms80.2msYAML::PP::Schema::::CORE:matchYAML::PP::Schema::CORE:match (opcode)
69391131.3ms35.8msYAML::PP::Schema::::create_mappingYAML::PP::Schema::create_mapping
285534116.4ms16.4msYAML::PP::Schema::::resolversYAML::PP::Schema::resolvers
645113.86ms4.18msYAML::PP::Schema::::create_sequenceYAML::PP::Schema::create_sequence
581112.82ms4.21msYAML::PP::Schema::::_bool_jsonpp_trueYAML::PP::Schema::_bool_jsonpp_true
408111.81ms2.74msYAML::PP::Schema::::_bool_jsonpp_falseYAML::PP::Schema::_bool_jsonpp_false
1111.60ms1.77msYAML::PP::Schema::::BEGIN@5YAML::PP::Schema::BEGIN@5
1111.43ms1.90msYAML::PP::Schema::::BEGIN@9YAML::PP::Schema::BEGIN@9
28111319µs335µsYAML::PP::Schema::::add_resolverYAML::PP::Schema::add_resolver
2861134µs157µsYAML::PP::Schema::::add_representerYAML::PP::Schema::add_representer
11141µs2.34msYAML::PP::Schema::::load_subschemasYAML::PP::Schema::load_subschemas
11126µs32µsYAML::PP::::BEGIN@1 YAML::PP::BEGIN@1
11124µs24µsYAML::PP::Schema::::newYAML::PP::Schema::new
281123µs23µsYAML::PP::Schema::::representersYAML::PP::Schema::representers
11110µs33µsYAML::PP::Schema::::BEGIN@11YAML::PP::Schema::BEGIN@11
1116µs8µsYAML::PP::Schema::::BEGIN@4YAML::PP::Schema::BEGIN@4
1115µs29µsYAML::PP::::BEGIN@2 YAML::PP::BEGIN@2
3114µs4µsYAML::PP::Schema::::falseYAML::PP::Schema::false
1114µs4µsYAML::PP::Schema::::yaml_versionYAML::PP::Schema::yaml_version
3113µs3µsYAML::PP::Schema::::trueYAML::PP::Schema::true
2111µs1µsYAML::PP::Schema::::bool_classYAML::PP::Schema::bool_class
0000s0sYAML::PP::Schema::::_bool_booleanpm_falseYAML::PP::Schema::_bool_booleanpm_false
0000s0sYAML::PP::Schema::::_bool_booleanpm_trueYAML::PP::Schema::_bool_booleanpm_true
0000s0sYAML::PP::Schema::::_bool_perl_falseYAML::PP::Schema::_bool_perl_false
0000s0sYAML::PP::Schema::::_bool_perl_trueYAML::PP::Schema::_bool_perl_true
0000s0sYAML::PP::Schema::::add_collection_resolverYAML::PP::Schema::add_collection_resolver
0000s0sYAML::PP::Schema::::add_mapping_resolverYAML::PP::Schema::add_mapping_resolver
0000s0sYAML::PP::Schema::::add_sequence_resolverYAML::PP::Schema::add_sequence_resolver
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1229µs238µs
# spent 32µs (26+6) within YAML::PP::BEGIN@1 which was called: # once (26µs+6µs) by YAML::PP::BEGIN@8 at line 1
use strict;
# spent 32µs making 1 call to YAML::PP::BEGIN@1 # spent 6µs making 1 call to strict::import
2224µs253µs
# spent 29µs (5+24) within YAML::PP::BEGIN@2 which was called: # once (5µs+24µs) by YAML::PP::BEGIN@8 at line 2
use warnings;
# spent 29µs making 1 call to YAML::PP::BEGIN@2 # spent 24µs making 1 call to warnings::import
3package YAML::PP::Schema;
4220µs210µs
# spent 8µs (6+2) within YAML::PP::Schema::BEGIN@4 which was called: # once (6µs+2µs) by YAML::PP::BEGIN@8 at line 4
use B;
# spent 8µs making 1 call to YAML::PP::Schema::BEGIN@4 # spent 2µs making 1 call to B::import
52711µs11.77ms
# spent 1.77ms (1.60+168µs) within YAML::PP::Schema::BEGIN@5 which was called: # once (1.60ms+168µs) by YAML::PP::BEGIN@8 at line 5
use Module::Load qw//;
# spent 1.77ms making 1 call to YAML::PP::Schema::BEGIN@5
6
710sour $VERSION = '0.035'; # VERSION
8
92577µs21.98ms
# spent 1.90ms (1.43+468µs) within YAML::PP::Schema::BEGIN@9 which was called: # once (1.43ms+468µs) by YAML::PP::BEGIN@8 at line 9
use YAML::PP::Common qw/ YAML_PLAIN_SCALAR_STYLE /;
# spent 1.90ms making 1 call to YAML::PP::Schema::BEGIN@9 # spent 76µs making 1 call to Exporter::import
10
1122.11ms256µs
# spent 33µs (10+23) within YAML::PP::Schema::BEGIN@11 which was called: # once (10µs+23µs) by YAML::PP::BEGIN@8 at line 11
use Scalar::Util qw/ blessed /;
# spent 33µs making 1 call to YAML::PP::Schema::BEGIN@11 # spent 23µs making 1 call to Exporter::import
12
13
# spent 24µs within YAML::PP::Schema::new which was called: # once (24µs+0s) by YAML::PP::new at line 55 of YAML/PP.pm
sub new {
1412µs my ($class, %args) = @_;
15
1611µs my $yaml_version = delete $args{yaml_version};
1711µs my $bool = delete $args{boolean};
1810s $bool = 'perl' unless defined $bool;
1910s if (keys %args) {
20 die "Unexpected arguments: " . join ', ', sort keys %args;
21 }
2211µs my $true;
23 my $false;
24 my @bool_class;
2512µs my @bools = split m/,/, $bool;
2611µs for my $b (@bools) {
2711µs if ($b eq '*') {
28 push @bool_class, ('boolean', 'JSON::PP::Boolean');
29 last;
30 }
31 elsif ($b eq 'JSON::PP') {
3211µs require JSON::PP;
3311µs $true ||= \&_bool_jsonpp_true;
3411µs $false ||= \&_bool_jsonpp_false;
3511µs push @bool_class, 'JSON::PP::Boolean';
36 }
37 elsif ($b eq 'boolean') {
38 require boolean;
39 $true ||= \&_bool_booleanpm_true;
40 $false ||= \&_bool_booleanpm_false;
41 push @bool_class, 'boolean';
42 }
43 elsif ($b eq 'perl') {
44 $true ||= \&_bool_perl_true;
45 $false ||= \&_bool_perl_false;
46 }
47 elsif ($b eq 'perl_experimental') {
48 $true ||= \&_bool_perl_true;
49 $false ||= \&_bool_perl_false;
50 push @bool_class, 'perl_experimental';
51 }
52 else {
53 die "Invalid value for 'boolean': '$b'. Allowed: ('perl', 'boolean', 'JSON::PP')";
54 }
55 }
56
5715µs my %representers = (
58 'undef' => undef,
59 flags => [],
60 equals => {},
61 regex => [],
62 class_equals => {},
63 class_matches => [],
64 class_isa => [],
65 scalarref => undef,
66 refref => undef,
67 coderef => undef,
68 glob => undef,
69 tied_equals => {},
70 );
7113µs my $self = bless {
72 yaml_version => $yaml_version,
73 resolvers => {},
74 representers => \%representers,
75 true => $true,
76 false => $false,
77 bool_class => \@bool_class,
78 }, $class;
7915µs return $self;
80}
81
822855345.7ms
# spent 16.4ms within YAML::PP::Schema::resolvers which was called 28553 times, avg 575ns/call: # 20941 times (11.6ms+0s) by YAML::PP::Schema::load_scalar at line 308, avg 554ns/call # 6939 times (4.48ms+0s) by YAML::PP::Schema::create_mapping at line 392, avg 645ns/call # 645 times (312µs+0s) by YAML::PP::Schema::create_sequence at line 362, avg 484ns/call # 28 times (16µs+0s) by YAML::PP::Schema::add_resolver at line 153, avg 571ns/call
sub resolvers { return $_[0]->{resolvers} }
832846µs
# spent 23µs within YAML::PP::Schema::representers which was called 28 times, avg 821ns/call: # 28 times (23µs+0s) by YAML::PP::Schema::add_representer at line 225, avg 821ns/call
sub representers { return $_[0]->{representers} }
84
8537µs
# spent 3µs within YAML::PP::Schema::true which was called 3 times, avg 1µs/call: # 3 times (3µs+0s) by YAML::PP::Schema::Core::register at line 35 of YAML/PP/Schema/Core.pm, avg 1µs/call
sub true { return $_[0]->{true} }
8638µs
# spent 4µs within YAML::PP::Schema::false which was called 3 times, avg 1µs/call: # 3 times (4µs+0s) by YAML::PP::Schema::Core::register at line 39 of YAML/PP/Schema/Core.pm, avg 1µs/call
sub false { return $_[0]->{false} }
8724µs
# spent 1µs within YAML::PP::Schema::bool_class which was called 2 times, avg 500ns/call: # 2 times (1µs+0s) by YAML::PP::Schema::Core::register at line 98 of YAML/PP/Schema/Core.pm, avg 500ns/call
sub bool_class { return @{ $_[0]->{bool_class} } ? $_[0]->{bool_class} : undef }
8816µs
# spent 4µs within YAML::PP::Schema::yaml_version which was called: # once (4µs+0s) by YAML::PP::Schema::load_subschemas at line 100
sub yaml_version { return $_[0]->{yaml_version} }
89
9012µsmy %LOADED_SCHEMA = (
91 JSON => 1,
92);
9311µsmy %DEFAULT_SCHEMA = (
94 '1.2' => 'Core',
95 '1.1' => 'YAML1_1',
96);
97
98
# spent 2.34ms (41µs+2.30) within YAML::PP::Schema::load_subschemas which was called: # once (41µs+2.30ms) by YAML::PP::new at line 59 of YAML/PP.pm
sub load_subschemas {
9911µs my ($self, @schemas) = @_;
10012µs14µs my $yaml_version = $self->yaml_version;
# spent 4µs making 1 call to YAML::PP::Schema::yaml_version
10111µs my $i = 0;
10215µs while ($i < @schemas) {
10311µs my $item = $schemas[ $i ];
10411µs if ($item eq '+') {
105 $item = $DEFAULT_SCHEMA{ $yaml_version };
106 }
10711µs $i++;
10813µs10s if (blessed($item)) {
# spent 0s making 1 call to Scalar::Util::blessed
109 $item->register(
110 schema => $self,
111 );
112 next;
113 }
11410s my @options;
11511µs while ($i < @schemas
116 and (
117 $schemas[ $i ] =~ m/^[^A-Za-z]/
118 or
119 $schemas[ $i ] =~ m/^[a-zA-Z0-9]+=/
120 )
121 ) {
122 push @options, $schemas[ $i ];
123 $i++;
124 }
125
12611µs my $class;
12717µs11µs if ($item =~ m/^\:(.*)/) {
# spent 1µs making 1 call to YAML::PP::Schema::CORE:match
128 $class = "$1";
129 unless ($class =~ m/\A[A-Za-z0-9_:]+\z/) {
130 die "Module name '$class' is invalid";
131 }
132 Module::Load::load $class;
133 }
134 else {
13511µs $class = "YAML::PP::Schema::$item";
13616µs13µs unless ($class =~ m/\A[A-Za-z0-9_:]+\z/) {
# spent 3µs making 1 call to YAML::PP::Schema::CORE:match
137 die "Module name '$class' is invalid";
138 }
13913µs12µs $LOADED_SCHEMA{ $item } ||= Module::Load::load $class;
# spent 2µs making 1 call to Module::Load::load
140 }
14113µs1754µs $class->register(
# spent 754µs making 1 call to YAML::PP::Schema::Core::register
142 schema => $self,
143 options => \@options,
144 );
145
146 }
147}
148
149
# spent 335µs (319+16) within YAML::PP::Schema::add_resolver which was called 28 times, avg 12µs/call: # 6 times (108µs+2µs) by YAML::PP::Schema::Core::register at line 59 of YAML/PP/Schema/Core.pm, avg 18µs/call # 5 times (64µs+2µs) by YAML::PP::Schema::Core::register at line 31 of YAML/PP/Schema/Core.pm, avg 13µs/call # 3 times (28µs+2µs) by YAML::PP::Schema::Core::register at line 39 of YAML/PP/Schema/Core.pm, avg 10µs/call # 3 times (28µs+2µs) by YAML::PP::Schema::Core::register at line 63 of YAML/PP/Schema/Core.pm, avg 10µs/call # 3 times (25µs+3µs) by YAML::PP::Schema::Core::register at line 35 of YAML/PP/Schema/Core.pm, avg 9µs/call # 3 times (25µs+2µs) by YAML::PP::Schema::Core::register at line 67 of YAML/PP/Schema/Core.pm, avg 9µs/call # once (10µs+0s) by YAML::PP::Schema::Core::register at line 40 of YAML/PP/Schema/Core.pm # once (10µs+0s) by YAML::PP::Schema::Core::register at line 48 of YAML/PP/Schema/Core.pm # once (8µs+1µs) by YAML::PP::Schema::Core::register at line 70 of YAML/PP/Schema/Core.pm # once (7µs+1000ns) by YAML::PP::Schema::Core::register at line 52 of YAML/PP/Schema/Core.pm # once (6µs+1000ns) by YAML::PP::Schema::Core::register at line 44 of YAML/PP/Schema/Core.pm
sub add_resolver {
1502810µs my ($self, %args) = @_;
151288µs my $tag = $args{tag};
152284µs my $rule = $args{match};
1532819µs2816µs my $resolvers = $self->resolvers;
# spent 16µs making 28 calls to YAML::PP::Schema::resolvers, avg 571ns/call
1542810µs my ($type, @rule) = @$rule;
155281µs my $implicit = $args{implicit};
156287µs $implicit = 1 unless defined $implicit;
157285µs my $resolver_list = [];
158289µs if ($tag) {
1592812µs if (ref $tag eq 'Regexp') {
160 my $res = $resolvers->{tags} ||= [];
161 push @$res, [ $tag, {} ];
162 push @$resolver_list, $res->[-1]->[1];
163 }
164 else {
1652815µs my $res = $resolvers->{tag}->{ $tag } ||= {};
166288µs push @$resolver_list, $res;
167 }
168 }
1692811µs if ($implicit) {
170 push @$resolver_list, $resolvers->{value} ||= {};
171 }
1722883µs for my $res (@$resolver_list) {
173569µs if ($type eq 'equals') {
1744614µs my ($match, $value) = @rule;
1754632µs unless (exists $res->{equals}->{ $match }) {
176 $res->{equals}->{ $match } = $value;
177 }
1784610µs next;
179 }
180 elsif ($type eq 'regex') {
18181µs my ($match, $value) = @rule;
18284µs push @{ $res->{regex} }, [ $match => $value ];
183 }
184 elsif ($type eq 'all') {
18520s my ($value) = @rule;
18621µs $res->{all} = $value;
187 }
188 }
189}
190
191sub add_sequence_resolver {
192 my ($self, %args) = @_;
193 return $self->add_collection_resolver(sequence => %args);
194}
195
196sub add_mapping_resolver {
197 my ($self, %args) = @_;
198 return $self->add_collection_resolver(mapping => %args);
199}
200
201sub add_collection_resolver {
202 my ($self, $type, %args) = @_;
203 my $tag = $args{tag};
204 my $implicit = $args{implicit};
205 my $resolvers = $self->resolvers;
206
207 if ($tag and ref $tag eq 'Regexp') {
208 my $res = $resolvers->{ $type }->{tags} ||= [];
209 push @$res, [ $tag, {
210 on_create => $args{on_create},
211 on_data => $args{on_data},
212 } ];
213 }
214 elsif ($tag) {
215 my $res = $resolvers->{ $type }->{tag}->{ $tag } ||= {
216 on_create => $args{on_create},
217 on_data => $args{on_data},
218 };
219 }
220}
221
222
# spent 157µs (134+23) within YAML::PP::Schema::add_representer which was called 28 times, avg 6µs/call: # 23 times (102µs+14µs) by YAML::PP::Schema::Core::register at line 89 of YAML/PP/Schema/Core.pm, avg 5µs/call # once (10µs+0s) by YAML::PP::Schema::Core::register at line 75 of YAML/PP/Schema/Core.pm # once (1µs+8µs) by YAML::PP::Schema::Core::register at line 93 of YAML/PP/Schema/Core.pm # once (9µs+0s) by YAML::PP::Schema::Core::register at line 83 of YAML/PP/Schema/Core.pm # once (6µs+1000ns) by YAML::PP::Schema::Core::register at line 100 of YAML/PP/Schema/Core.pm # once (6µs+0s) by YAML::PP::Schema::Core::register at line 79 of YAML/PP/Schema/Core.pm
sub add_representer {
2232814µs my ($self, %args) = @_;
224
2252817µs2823µs my $representers = $self->representers;
# spent 23µs making 28 calls to YAML::PP::Schema::representers, avg 821ns/call
226287µs if (my $flags = $args{flags}) {
22722µs my $rep = $representers->{flags};
22821µs push @$rep, \%args;
229210µs return;
230 }
231265µs if (my $regex = $args{regex}) {
23210s my $rep = $representers->{regex};
23310s push @$rep, \%args;
23412µs return;
235 }
236255µs if (my $regex = $args{class_matches}) {
237 my $rep = $representers->{class_matches};
238 push @$rep, [ $args{class_matches}, $args{code} ];
239 return;
240 }
241251µs if (my $class_equals = $args{class_equals}) {
24211µs if ($] >= 5.036000 and $class_equals eq 'perl_experimental') {
243 $representers->{bool} = {
244 code => $args{code},
245 };
246 return;
247 }
24810s my $rep = $representers->{class_equals};
249 $rep->{ $class_equals } = {
250 code => $args{code},
25111µs };
25214µs return;
253 }
254244µs if (my $class_isa = $args{class_isa}) {
255 my $rep = $representers->{class_isa};
256 push @$rep, [ $args{class_isa}, $args{code} ];
257 return;
258 }
259243µs if (my $tied_equals = $args{tied_equals}) {
260 my $rep = $representers->{tied_equals};
261 $rep->{ $tied_equals } = {
262 code => $args{code},
263 };
264 return;
265 }
266247µs if (defined(my $equals = $args{equals})) {
267236µs my $rep = $representers->{equals};
268 $rep->{ $equals } = {
269 code => $args{code},
2702316µs };
2712336µs return;
272 }
27311µs if (defined(my $scalarref = $args{scalarref})) {
274 $representers->{scalarref} = {
275 code => $args{code},
276 };
277 return;
278 }
27910s if (defined(my $refref = $args{refref})) {
280 $representers->{refref} = {
281 code => $args{code},
282 };
283 return;
284 }
28510s if (defined(my $coderef = $args{coderef})) {
286 $representers->{coderef} = {
287 code => $args{code},
288 };
289 return;
290 }
29111µs if (defined(my $glob = $args{glob})) {
292 $representers->{glob} = {
293 code => $args{code},
294 };
295 return;
296 }
29710s if (my $undef = $args{undefined}) {
29810s $representers->{undef} = $undef;
29913µs return;
300 }
301}
302
303
# spent 608ms (403+205) within YAML::PP::Schema::load_scalar which was called 20941 times, avg 29µs/call: # 20941 times (403ms+205ms) by YAML::PP::Constructor::scalar_event at line 287 of YAML/PP/Constructor.pm, avg 29µs/call
sub load_scalar {
304209414.42ms my ($self, $constructor, $event) = @_;
305209415.33ms my $tag = $event->{tag};
306209416.79ms my $value = $event->{value};
307
3082094116.9ms2094111.6ms my $resolvers = $self->resolvers;
# spent 11.6ms making 20941 calls to YAML::PP::Schema::resolvers, avg 554ns/call
309209412.69ms my $res;
310209417.11ms if ($tag) {
311 $res = $resolvers->{tag}->{ $tag };
312 if (not $res and my $matches = $resolvers->{tags}) {
313 for my $match (@$matches) {
314 my ($re, $rule) = @$match;
315 if ($tag =~ $re) {
316 $res = $rule;
317 last;
318 }
319 }
320 }
321 }
322 else {
323209414.30ms $res = $resolvers->{value};
3242094111.6ms if ($event->{style} ne YAML_PLAIN_SCALAR_STYLE) {
325 return $value;
326 }
327 }
328
329188848.39ms if (my $equals = $res->{equals}) {
3301888415.9ms if (exists $equals->{ $value }) {
3311024538µs my $res = $equals->{ $value };
33210243.57ms9896.95ms if (ref $res eq 'CODE') {
# spent 4.21ms making 581 calls to YAML::PP::Schema::_bool_jsonpp_true, avg 7µs/call # spent 2.74ms making 408 calls to YAML::PP::Schema::_bool_jsonpp_false, avg 7µs/call
333 return $res->($constructor, $event);
334 }
3353561µs return $res;
336 }
337 }
338178608.12ms if (my $regex = $res->{regex}) {
339178609.06ms for my $item (@$regex) {
3407099916.8ms my ($re, $sub) = @$item;
34170999337ms141998166ms my @matches = $value =~ $re;
# spent 85.3ms making 70999 calls to YAML::PP::Schema::CORE:regcomp, avg 1µs/call # spent 80.2ms making 70999 calls to YAML::PP::Schema::CORE:match, avg 1µs/call
3427099930.7ms147376µs if (@matches) {
# spent 376µs making 147 calls to YAML::PP::Schema::JSON::_to_int, avg 3µs/call
343 return $sub->($constructor, $event, \@matches);
344 }
345 }
346 }
347177135.27ms if (my $catch_all = $res->{all}) {
3481771356.1ms1771320.7ms if (ref $catch_all eq 'CODE') {
# spent 20.7ms making 17713 calls to YAML::PP::Schema::Core::__ANON__[YAML/PP/Schema/Core.pm:70], avg 1µs/call
349 return $catch_all->($constructor, $event);
350 }
351 return $catch_all;
352 }
353 return $value;
354}
355
356
# spent 4.18ms (3.86+312µs) within YAML::PP::Schema::create_sequence which was called 645 times, avg 6µs/call: # 645 times (3.86ms+312µs) by YAML::PP::Constructor::sequence_start_event at line 229 of YAML/PP/Constructor.pm, avg 6µs/call
sub create_sequence {
357645215µs my ($self, $constructor, $event) = @_;
358645373µs my $tag = $event->{tag};
359645459µs my $data = [];
360645111µs my $on_data;
361
362645841µs645312µs my $resolvers = $self->resolvers->{sequence};
# spent 312µs making 645 calls to YAML::PP::Schema::resolvers, avg 484ns/call
363645169µs if ($tag) {
364 if (my $equals = $resolvers->{tag}->{ $tag }) {
365 my $on_create = $equals->{on_create};
366 $on_data = $equals->{on_data};
367 $on_create and $data = $on_create->($constructor, $event);
368 return ($data, $on_data);
369 }
370 if (my $matches = $resolvers->{tags}) {
371 for my $match (@$matches) {
372 my ($re, $actions) = @$match;
373 my $on_create = $actions->{on_create};
374 if ($tag =~ $re) {
375 $on_data = $actions->{on_data};
376 $on_create and $data = $on_create->($constructor, $event);
377 return ($data, $on_data);
378 }
379 }
380 }
381 }
382
3836451.66ms return ($data, $on_data);
384}
385
386
# spent 35.8ms (31.3+4.48) within YAML::PP::Schema::create_mapping which was called 6939 times, avg 5µs/call: # 6939 times (31.3ms+4.48ms) by YAML::PP::Constructor::mapping_start_event at line 128 of YAML/PP/Constructor.pm, avg 5µs/call
sub create_mapping {
38769391.72ms my ($self, $constructor, $event) = @_;
38869392.24ms my $tag = $event->{tag};
38969392.44ms my $data = {};
39069391.10ms my $on_data;
391
39269398.32ms69394.48ms my $resolvers = $self->resolvers->{mapping};
# spent 4.48ms making 6939 calls to YAML::PP::Schema::resolvers, avg 645ns/call
39369391.49ms if ($tag) {
394 if (my $equals = $resolvers->{tag}->{ $tag }) {
395 my $on_create = $equals->{on_create};
396 $on_data = $equals->{on_data};
397 $on_create and $data = $on_create->($constructor, $event);
398 return ($data, $on_data);
399 }
400 if (my $matches = $resolvers->{tags}) {
401 for my $match (@$matches) {
402 my ($re, $actions) = @$match;
403 my $on_create = $actions->{on_create};
404 if ($tag =~ $re) {
405 $on_data = $actions->{on_data};
406 $on_create and $data = $on_create->($constructor, $event);
407 return ($data, $on_data);
408 }
409 }
410 }
411 }
412
413693912.3ms return ($data, $on_data);
414}
415
4165812.50ms5811.38ms
# spent 4.21ms (2.82+1.38) within YAML::PP::Schema::_bool_jsonpp_true which was called 581 times, avg 7µs/call: # 581 times (2.82ms+1.38ms) by YAML::PP::Schema::load_scalar at line 332, avg 7µs/call
sub _bool_jsonpp_true { JSON::PP::true() }
# spent 1.38ms making 581 calls to JSON::PP::true, avg 2µs/call
417
418sub _bool_booleanpm_true { boolean::true() }
419
420sub _bool_perl_true { !!1 }
421
4224081.60ms408930µs
# spent 2.74ms (1.81+930µs) within YAML::PP::Schema::_bool_jsonpp_false which was called 408 times, avg 7µs/call: # 408 times (1.81ms+930µs) by YAML::PP::Schema::load_scalar at line 332, avg 7µs/call
sub _bool_jsonpp_false { JSON::PP::false() }
# spent 930µs making 408 calls to JSON::PP::false, avg 2µs/call
423
424sub _bool_booleanpm_false { boolean::false() }
425
426sub _bool_perl_false { !!0 }
427
42815µs1;
429
430__END__
 
# spent 80.2ms within YAML::PP::Schema::CORE:match which was called 71001 times, avg 1µs/call: # 70999 times (80.2ms+0s) by YAML::PP::Schema::load_scalar at line 341, avg 1µs/call # once (3µs+0s) by YAML::PP::Schema::load_subschemas at line 136 # once (1µs+0s) by YAML::PP::Schema::load_subschemas at line 127
sub YAML::PP::Schema::CORE:match; # opcode
# spent 85.3ms within YAML::PP::Schema::CORE:regcomp which was called 70999 times, avg 1µs/call: # 70999 times (85.3ms+0s) by YAML::PP::Schema::load_scalar at line 341, avg 1µs/call
sub YAML::PP::Schema::CORE:regcomp; # opcode