← 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/JSON/Schema/Modern/Vocabulary/Applicator.pm
StatementsExecuted 1339973 statements in 3.52s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
94075211.08s1.56sJSON::Schema::Modern::Vocabulary::Applicator::::keywordsJSON::Schema::Modern::Vocabulary::Applicator::keywords
3249211857ms97.0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_propertiesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties (recurses: max depth 10, inclusive time 294s)
600211535ms71.3sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_allOfJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf (recurses: max depth 13, inclusive time 190s)
19715021233ms233msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:regcompJSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp (opcode)
361611220ms80.3sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_patternPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties (recurses: max depth 3, inclusive time 105s)
18815011162ms162msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:qrJSON::Schema::Modern::Vocabulary::Applicator::CORE:qr (opcode)
19715021129ms129msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:matchJSON::Schema::Modern::Vocabulary::Applicator::CORE:match (opcode)
30131189.3ms72.7sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_ifJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if (recurses: max depth 1, inclusive time 4.31s)
9771182.9ms67.2sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_additionalPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties (recurses: max depth 4, inclusive time 40.8s)
377607155.2ms55.2msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:sortJSON::Schema::Modern::Vocabulary::Applicator::CORE:sort (opcode)
17581152.5ms23.8sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword__items_schemaJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema (recurses: max depth 4, inclusive time 2.65s)
11821144.3ms3.16sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_anyOfJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf
6271124.1ms496msJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_propertyNamesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames
17581112.5ms23.8sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_itemsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items (recurses: max depth 4, inclusive time 2.66s)
3051112.1ms324msJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_oneOfJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf
305118.75ms4.33sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_dependentSchemasJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas
1112.06ms4.48msJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@21JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21
1111.93ms2.12msJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@19JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19
387111.40ms325msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_propertiesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties (recurses: max depth 3, inclusive time 34.2ms)
9811711µs97.2msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_itemsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items (recurses: max depth 1, inclusive time 3.98ms)
13011642µs32.1msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_additionalPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties (recurses: max depth 1, inclusive time 7.30ms)
6511280µs15.0msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_ifJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if
6511241µs19.5msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_thenJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then
3211143µs18.7msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_anyOfJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf (recurses: max depth 1, inclusive time 186µs)
711136µs1.82msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_patternPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties
2311124µs25.4msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_allOfJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf
2211107µs15.9msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_oneOfJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf
141166µs3.63msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_propertyNamesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames
141158µs1.72msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_notJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not
151157µs3.69msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_elseJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else
41156µs2.63msJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_notJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not
11132µs36µsModule::Runtime::::BEGIN@1.306 Module::Runtime::BEGIN@1.306
11122µs811µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@11JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11
31117µs6.74msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_containsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains
11116µs57µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@17JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17
11114µs37µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@13JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13
11114µs14µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@9JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9
21111µs6.00msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_dependentSchemasJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas
11110µs23µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@14JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14
1119µs25µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@18JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18
1119µs62µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@20JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20
1118µs303µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@10JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10
1118µs16µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@15JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15
1118µs46µsModule::Runtime::::BEGIN@2.307 Module::Runtime::BEGIN@2.307
1117µs97µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@12JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12
1117µs251µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@22JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22
1116µs17µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@16JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16
4113µs3µsJSON::Schema::Modern::Vocabulary::Applicator::::evaluation_orderJSON::Schema::Modern::Vocabulary::Applicator::evaluation_order
1113µs3µsJSON::Schema::Modern::Vocabulary::Applicator::::vocabularyJSON::Schema::Modern::Vocabulary::Applicator::vocabulary
1110s0sJSON::Schema::Modern::Vocabulary::Applicator::::__ANON__JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ (xsub)
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::__ANON__[:498]JSON::Schema::Modern::Vocabulary::Applicator::__ANON__[:498]
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::__ANON__[:63]JSON::Schema::Modern::Vocabulary::Applicator::__ANON__[:63]
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword__items_array_schemasJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_array_schemas
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_additionalItemsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalItems
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_containsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_contains
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_dependenciesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependencies
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_prefixItemsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_prefixItems
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_additionalItemsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalItems
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_dependenciesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependencies
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_prefixItemsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_prefixItems
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1240µs240µs
# spent 36µs (32+4) within Module::Runtime::BEGIN@1.306 which was called: # once (32µs+4µs) by Module::Runtime::require_module at line 1
use strict;
# spent 36µs making 1 call to Module::Runtime::BEGIN@1.306 # spent 4µs making 1 call to strict::import
2263µs284µs
# spent 46µs (8+38) within Module::Runtime::BEGIN@2.307 which was called: # once (8µs+38µs) by Module::Runtime::require_module at line 2
use warnings;
# spent 46µs making 1 call to Module::Runtime::BEGIN@2.307 # spent 38µs making 1 call to warnings::import
3package JSON::Schema::Modern::Vocabulary::Applicator;
4# vim: set ts=8 sts=2 sw=2 tw=100 et :
5# ABSTRACT: Implementation of the JSON Schema Applicator vocabulary
6
710sour $VERSION = '0.552';
8
9241µs114µs
# spent 14µs within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9 which was called: # once (14µs+0s) by Module::Runtime::require_module at line 9
use 5.020;
10233µs2598µs
# spent 303µs (8+295) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10 which was called: # once (8µs+295µs) by Module::Runtime::require_module at line 10
use Moo;
# spent 303µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10 # spent 295µs making 1 call to Moo::import
11344µs31.60ms
# spent 811µs (22+789) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11 which was called: # once (22µs+789µs) by Module::Runtime::require_module at line 11
use strictures 2;
# spent 811µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11 # spent 770µs making 1 call to strictures::import # spent 19µs making 1 call to strictures::VERSION
12236µs2187µs
# spent 97µs (7+90) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12 which was called: # once (7µs+90µs) by Module::Runtime::require_module at line 12
use experimental qw(signatures postderef);
# spent 97µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12 # spent 90µs making 1 call to experimental::import
13223µs238µs
# spent 37µs (14+23) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13 which was called: # once (14µs+23µs) by Module::Runtime::require_module at line 13
use if "$]" >= 5.022, experimental => 're_strict';
# spent 37µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13 # spent 1µs making 1 call to if::import
14219µs226µs
# spent 23µs (10+13) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14 which was called: # once (10µs+13µs) by Module::Runtime::require_module at line 14
no if "$]" >= 5.031009, feature => 'indirect';
# spent 23µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14 # spent 3µs making 1 call to if::unimport
15216µs217µs
# spent 16µs (8+8) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15 which was called: # once (8µs+8µs) by Module::Runtime::require_module at line 15
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 16µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15 # spent 1µs making 1 call to if::unimport
16227µs218µs
# spent 17µs (6+11) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16 which was called: # once (6µs+11µs) by Module::Runtime::require_module at line 16
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 17µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16 # spent 1µs making 1 call to if::unimport
17332µs374µs
# spent 57µs (16+41) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17 which was called: # once (16µs+41µs) by Module::Runtime::require_module at line 17
use List::Util 1.45 qw(any uniqstr);
# spent 57µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17 # spent 10µs making 1 call to List::Util::import # spent 7µs making 1 call to UNIVERSAL::VERSION
18321µs341µs
# spent 25µs (9+16) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18 which was called: # once (9µs+16µs) by Module::Runtime::require_module at line 18
use Ref::Util 0.100 'is_plain_arrayref';
# spent 25µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18 # spent 13µs making 1 call to Exporter::import # spent 3µs making 1 call to UNIVERSAL::VERSION
192655µs22.13ms
# spent 2.12ms (1.93+200µs) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19 which was called: # once (1.93ms+200µs) by Module::Runtime::require_module at line 19
use Sub::Install;
20220µs2115µs
# spent 62µs (9+53) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20 which was called: # once (9µs+53µs) by Module::Runtime::require_module at line 20
use JSON::Schema::Modern::Utilities qw(is_type jsonp E A assert_keyword_type assert_pattern true is_elements_unique);
# spent 62µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20 # spent 53µs making 1 call to Exporter::import
212496µs24.48ms
# spent 4.48ms (2.06+2.42) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21 which was called: # once (2.06ms+2.42ms) by Module::Runtime::require_module at line 21
use JSON::Schema::Modern::Vocabulary::Unevaluated;
2223.26ms2495µs
# spent 251µs (7+244) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22 which was called: # once (7µs+244µs) by Module::Runtime::require_module at line 22
use namespace::clean;
# spent 251µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22 # spent 244µs making 1 call to namespace::clean::import
23
2411µs1352µswith 'JSON::Schema::Modern::Vocabulary';
# spent 352µs making 1 call to Moo::with
25
26
# spent 3µs within JSON::Schema::Modern::Vocabulary::Applicator::vocabulary which was called: # once (3µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:670] at line 666 of JSON/Schema/Modern.pm
sub vocabulary {
2714µs 'https://json-schema.org/draft/2019-09/vocab/applicator' => 'draft2019-09',
28 'https://json-schema.org/draft/2020-12/vocab/applicator' => 'draft2020-12';
29}
30
3148µs
# spent 3µs within JSON::Schema::Modern::Vocabulary::Applicator::evaluation_order which was called 4 times, avg 750ns/call: # 4 times (3µs+0s) by JSON::Schema::Modern::Vocabulary::Core::CORE:sort at line 322 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 750ns/call
sub evaluation_order { 1 }
32
33# the keyword order is arbitrary, except:
34# - if must be evaluated before then, else
35# - items must be evaluated before additionalItems
36# - in-place applicators (allOf, anyOf, oneOf, not, if/then/else, dependentSchemas) and items,
37# additionalItems must be evaluated before unevaluatedItems (in the Unevaluated vocabulary)
38# - properties and patternProperties must be evaluated before additionalProperties
39# - in-place applicators and properties, patternProperties, additionalProperties must be evaluated
40# before unevaluatedProperties (in the Unevaluated vocabulary)
41# - contains must be evaluated before maxContains, minContains (in the Validator vocabulary)
4228222552.3ms
# spent 1.56s (1.08+474ms) within JSON::Schema::Modern::Vocabulary::Applicator::keywords which was called 94075 times, avg 17µs/call: # 91595 times (1.06s+463ms) by JSON::Schema::Modern::_eval_subschema at line 535 of JSON/Schema/Modern.pm, avg 17µs/call # 2480 times (25.6ms+11.8ms) by JSON::Schema::Modern::_traverse_subschema at line 447 of JSON/Schema/Modern.pm, avg 15µs/call
sub keywords ($self, $spec_version) {
43 return (
44940751.57s564450474ms qw(allOf anyOf oneOf not if then else),
# spent 187ms making 188150 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp, avg 996ns/call # spent 162ms making 188150 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr, avg 862ns/call # spent 125ms making 188150 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:match, avg 662ns/call
45 $spec_version eq 'draft7' ? 'dependencies' : 'dependentSchemas',
46 $spec_version !~ qr/^draft(7|2019-09)$/ ? 'prefixItems' : (),
47 'items',
48 $spec_version =~ qr/^draft(7|2019-09)$/ ? 'additionalItems' : (),
49 qw(contains properties patternProperties additionalProperties propertyNames),
50 $spec_version eq 'draft2019-09' ? qw(unevaluatedItems unevaluatedProperties) : (),
51 );
52}
53
54# in draft2019-09, the unevaluated keywords were part of the Applicator vocabulary
5510sforeach my $phase (qw(traverse eval)) {
5620s foreach my $type (qw(Items Properties)) {
5742µs my $method = '_'.$phase.'_keyword_unevaluated'.$type;
58 Sub::Install::install_sub({
59 as => $method,
60 code => sub {
61 shift;
62 JSON::Schema::Modern::Vocabulary::Unevaluated->$method(@_);
63 }
6449µs485µs }),
# spent 85µs making 4 calls to Sub::Install::__ANON__[Sub/Install.pm:118], avg 21µs/call
65 }
66}
67
682391µs2324.3ms
# spent 25.4ms (124µs+25.3) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf which was called 23 times, avg 1.10ms/call: # 23 times (124µs+25.3ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 1.10ms/call
sub _traverse_keyword_allOf { shift->traverse_array_schemas(@_) }
# spent 25.3ms making 23 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 1.10ms/call, recursion: max depth 1, sum of overlapping time 1.01ms
69
70300106.04ms
# spent 71.3s (535ms+70.7) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf which was called 6002 times, avg 11.9ms/call: # 6002 times (535ms+70.7s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 11.9ms/call
sub _eval_keyword_allOf ($self, $data, $schema, $state) {
7160021.50ms my @invalid;
7260024.50ms my @orig_annotations = $state->{annotations}->@*;
736002613µs my @new_annotations;
74600211.6ms foreach my $idx (0 .. $schema->{allOf}->$#*) {
752575011.9ms my @annotations = @orig_annotations;
7625750406ms257500s if ($self->eval($data, $schema->{allOf}[$idx], +{ %$state,
# spent 261s making 25750 calls to JSON::Schema::Modern::Vocabulary::eval, avg 10.1ms/call, recursion: max depth 32, sum of overlapping time 261s
77 schema_path => $state->{schema_path}.'/allOf/'.$idx, annotations => \@annotations })) {
78 push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
79 }
80 else {
81 push @invalid, $idx;
82 last if $state->{short_circuit};
83 }
84 }
85
86600226.9ms push $state->{annotations}->@*, @new_annotations;
87600224.7ms return 1 if @invalid == 0;
88
89 my $pl = @invalid > 1;
90 return E($state, 'subschema%s %s %s not valid', $pl?'s':'', join(', ', @invalid), $pl?'are':'is');
91}
92
9332166µs3217.4ms
# spent 18.7ms (143µs+18.6) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf which was called 32 times, avg 585µs/call: # 32 times (143µs+18.6ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 585µs/call
sub _traverse_keyword_anyOf { shift->traverse_array_schemas(@_) }
# spent 18.7ms making 32 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 586µs/call, recursion: max depth 2, sum of overlapping time 1.36ms
94
9559101.89ms
# spent 3.16s (44.3ms+3.12) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf which was called 1182 times, avg 2.68ms/call: # 1182 times (44.3ms+3.12s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 2.68ms/call
sub _eval_keyword_anyOf ($self, $data, $schema, $state) {
961182205µs my $valid = 0;
971182250µs my @errors;
9811823.39ms foreach my $idx (0 .. $schema->{anyOf}->$#*) {
99 next if not $self->eval($data, $schema->{anyOf}[$idx],
100236529.4ms23654.08ms +{ %$state, errors => \@errors, schema_path => $state->{schema_path}.'/anyOf/'.$idx });
# spent 3.12s making 2365 calls to JSON::Schema::Modern::Vocabulary::eval, avg 1.32ms/call, recursion: max depth 34, sum of overlapping time 3.11s
1011183625µs ++$valid;
10211831.39ms last if $state->{short_circuit};
103 }
104
10511826.03ms return 1 if $valid;
106 push $state->{errors}->@*, @errors;
107 return E($state, 'no subschemas are valid');
108}
109
11022126µs2215.8ms
# spent 15.9ms (107µs+15.8) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf which was called 22 times, avg 723µs/call: # 22 times (107µs+15.8ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 723µs/call
sub _traverse_keyword_oneOf { shift->traverse_array_schemas(@_) }
# spent 15.8ms making 22 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 718µs/call
111
1121525373µs
# spent 324ms (12.1+311) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf which was called 305 times, avg 1.06ms/call: # 305 times (12.1ms+311ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 1.06ms/call
sub _eval_keyword_oneOf ($self, $data, $schema, $state) {
11330588µs my (@valid, @errors);
114305270µs my @orig_annotations = $state->{annotations}->@*;
11530553µs my @new_annotations;
116305773µs foreach my $idx (0 .. $schema->{oneOf}->$#*) {
117610270µs my @annotations = @orig_annotations;
118 next if not $self->eval($data, $schema->{oneOf}[$idx],
119 +{ %$state, errors => \@errors, annotations => \@annotations,
1206107.28ms6100s schema_path => $state->{schema_path}.'/oneOf/'.$idx });
# spent 311ms making 610 calls to JSON::Schema::Modern::Vocabulary::eval, avg 511µs/call, recursion: max depth 9, sum of overlapping time 311ms
121305274µs push @valid, $idx;
122305192µs push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
123305397µs last if @valid > 1 and $state->{short_circuit};
124 }
125
126305228µs push $state->{annotations}->@*, @new_annotations;
1273051.75ms return 1 if @valid == 1;
128
129 if (not @valid) {
130 push $state->{errors}->@*, @errors;
131 return E($state, 'no subschemas are valid');
132 }
133 else {
134 return E($state, 'multiple subschemas are valid: '.join(', ', @valid));
135 }
136}
137
1381459µs141.11ms
# spent 1.72ms (58µs+1.66) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not which was called 14 times, avg 123µs/call: # 14 times (58µs+1.66ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 123µs/call
sub _traverse_keyword_not { shift->traverse_subschema(@_) }
# spent 1.66ms making 14 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 118µs/call, recursion: max depth 1, sum of overlapping time 547µs
139
140202µs
# spent 2.63ms (56µs+2.57) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not which was called 4 times, avg 657µs/call: # 4 times (56µs+2.57ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 657µs/call
sub _eval_keyword_not ($self, $data, $schema, $state) {
141 return 1 if not $self->eval($data, $schema->{not},
142 +{ %$state, schema_path => $state->{schema_path}.'/not',
143 short_circuit => $state->{short_circuit} || !$state->{collect_annotations},
144453µs40s errors => [] });
# spent 2.57ms making 4 calls to JSON::Schema::Modern::Vocabulary::eval, avg 643µs/call, recursion: max depth 12, sum of overlapping time 2.57ms
145
146 return E($state, 'subschema is valid');
147}
148
14965264µs6512.2ms
# spent 15.0ms (280µs+14.7) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if which was called 65 times, avg 230µs/call: # 65 times (280µs+14.7ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 230µs/call
sub _traverse_keyword_if { shift->traverse_subschema(@_) }
# spent 14.7ms making 65 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 226µs/call, recursion: max depth 2, sum of overlapping time 2.47ms
15065229µs6516.1ms
# spent 19.5ms (241µs+19.3) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then which was called 65 times, avg 300µs/call: # 65 times (241µs+19.3ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 300µs/call
sub _traverse_keyword_then { shift->traverse_subschema(@_) }
# spent 19.3ms making 65 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 296µs/call, recursion: max depth 2, sum of overlapping time 3.18ms
1511553µs153.63ms
# spent 3.69ms (57µs+3.63) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else which was called 15 times, avg 246µs/call: # 15 times (57µs+3.63ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 246µs/call
sub _traverse_keyword_else { shift->traverse_subschema(@_) }
# spent 3.63ms making 15 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 242µs/call
152
153150653.93ms
# spent 72.7s (89.3ms+72.6) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if which was called 3013 times, avg 24.1ms/call: # 3013 times (89.3ms+72.6s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 24.1ms/call
sub _eval_keyword_if ($self, $data, $schema, $state) {
154 return 1 if not exists $schema->{then} and not exists $schema->{else}
15530131.33ms and not $state->{collect_annotations};
156 my $keyword = $self->eval($data, $schema->{if},
157 +{ %$state, schema_path => $state->{schema_path}.'/if',
158 short_circuit => $state->{short_circuit} || !$state->{collect_annotations},
159301348.7ms30130s errors => [],
# spent 2.72s making 3013 calls to JSON::Schema::Modern::Vocabulary::eval, avg 904µs/call, recursion: max depth 11, sum of overlapping time 2.72s
160 })
161 ? 'then' : 'else';
162
16330134.22ms return 1 if not exists $schema->{$keyword};
164 return 1 if $self->eval($data, $schema->{$keyword},
165221427.5ms22140s +{ %$state, schema_path => $state->{schema_path}.'/'.$keyword });
# spent 74.2s making 2214 calls to JSON::Schema::Modern::Vocabulary::eval, avg 33.5ms/call, recursion: max depth 11, sum of overlapping time 74.2s
166 return E({ %$state, keyword => $keyword }, 'subschema is not valid');
167}
168
16929µs20s
# spent 6.00ms (11µs+5.98) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas which was called 2 times, avg 3.00ms/call: # 2 times (11µs+5.98ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 3.00ms/call
sub _traverse_keyword_dependentSchemas { shift->traverse_object_schemas(@_) }
# spent 5.98ms making 2 calls to JSON::Schema::Modern::Vocabulary::traverse_object_schemas, avg 2.99ms/call, recursion: max depth 1, sum of overlapping time 5.98ms
170
1711525451µs
# spent 4.33s (8.75ms+4.32) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas which was called 305 times, avg 14.2ms/call: # 305 times (8.75ms+4.32s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 14.2ms/call
sub _eval_keyword_dependentSchemas ($self, $data, $schema, $state) {
172305373µs305580µs return 1 if not is_type('object', $data);
# spent 580µs making 305 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call
173
17430576µs my $valid = 1;
175305172µs my @orig_annotations = $state->{annotations}->@*;
17630564µs my @new_annotations;
1773051.21ms305156µs foreach my $property (sort keys $schema->{dependentSchemas}->%*) {
# spent 156µs making 305 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 511ns/call
178305130µs next if not exists $data->{$property};
179
180290125µs my @annotations = @orig_annotations;
1812902.49ms5802.37ms if ($self->eval($data, $schema->{dependentSchemas}{$property},
# spent 2.37ms making 290 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call # spent 4.32s making 290 calls to JSON::Schema::Modern::Vocabulary::eval, avg 14.9ms/call, recursion: max depth 9, sum of overlapping time 4.32s
182 +{ %$state, annotations => \@annotations,
183 schema_path => jsonp($state->{schema_path}, 'dependentSchemas', $property) })) {
184290298µs push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
1852901.43ms next;
186 }
187
188 $valid = 0;
189 last if $state->{short_circuit};
190 }
191
192305525µs push $state->{annotations}->@*, @new_annotations;
19330559µs return E($state, 'not all dependencies are satisfied') if not $valid;
1943051.09ms return 1;
195}
196
197sub _traverse_keyword_dependencies ($self, $schema, $state) {
198 return if not assert_keyword_type($state, $schema, 'object');
199
200 my $valid = 1;
201 foreach my $property (sort keys $schema->{dependencies}->%*) {
202 if (is_type('array', $schema->{dependencies}{$property})) {
203 # as in dependentRequired
204
205 foreach my $index (0..$schema->{dependencies}{$property}->$#*) {
206 $valid = E({ %$state, _schema_path_suffix => [ $property, $index ] }, 'element #%d is not a string', $index)
207 if not is_type('string', $schema->{dependencies}{$property}[$index]);
208 }
209
210 $valid = E({ %$state, _schema_path_suffix => $property }, 'elements are not unique')
211 if not is_elements_unique($schema->{dependencies}{$property});
212 }
213 else {
214 # as in dependentSchemas
215 $valid = 0 if not $self->traverse_property_schema($schema, $state, $property);
216 }
217 }
218 return $valid;
219}
220
221sub _eval_keyword_dependencies ($self, $data, $schema, $state) {
222 return 1 if not is_type('object', $data);
223
224 my $valid = 1;
225 my @orig_annotations = $state->{annotations}->@*;
226 my @new_annotations;
227 foreach my $property (sort keys $schema->{dependencies}->%*) {
228 next if not exists $data->{$property};
229
230 if (is_type('array', $schema->{dependencies}{$property})) {
231 # as in dependentRequired
232 if (my @missing = grep !exists($data->{$_}), $schema->{dependencies}{$property}->@*) {
233 $valid = E({ %$state, _schema_path_suffix => $property },
234 'missing propert%s: %s', @missing > 1 ? 'ies' : 'y', join(', ', @missing));
235 }
236 }
237 else {
238 # as in dependentSchemas
239 my @annotations = @orig_annotations;
240 if ($self->eval($data, $schema->{dependencies}{$property},
241 +{ %$state, annotations => \@annotations,
242 schema_path => jsonp($state->{schema_path}, 'dependencies', $property) })) {
243 push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
244 next;
245 }
246
247 $valid = 0;
248 last if $state->{short_circuit};
249 }
250 }
251
252 push $state->{annotations}->@*, @new_annotations;
253 return E($state, 'not all dependencies are satisfied') if not $valid;
254 return 1;
255}
256
257sub _traverse_keyword_prefixItems { shift->traverse_array_schemas(@_) }
258
259sub _eval_keyword_prefixItems { shift->_eval_keyword__items_array_schemas(@_) }
260
26139283µs
# spent 97.2ms (711µs+96.5) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items which was called 98 times, avg 992µs/call: # 98 times (711µs+96.5ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 992µs/call
sub _traverse_keyword_items ($self, $schema, $state) {
2629894µs if (is_plain_arrayref($schema->{items})) {
263 return E($state, 'array form of "items" not supported in %s', $state->{spec_version})
264 if $state->{spec_version} !~ /^draft(?:7|2019-09)$/;
265
266 return $self->traverse_array_schemas($schema, $state);
267 }
268
26998583µs9894.3ms $self->traverse_subschema($schema, $state);
# spent 100ms making 98 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 1.03ms/call, recursion: max depth 1, sum of overlapping time 6.19ms
270}
271
27287902.73ms
# spent 23.8s (12.5ms+23.8) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items which was called 1758 times, avg 13.6ms/call: # 1758 times (12.5ms+23.8s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 13.6ms/call
sub _eval_keyword_items ($self, $data, $schema, $state) {
273 return $self->_eval_keyword__items_array_schemas($data, $schema, $state)
2741758927µs if is_plain_arrayref($schema->{items});
275
27617587.60ms175823.8s return $self->_eval_keyword__items_schema($data, $schema, $state);
# spent 26.5s making 1758 calls to JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema, avg 15.1ms/call, recursion: max depth 4, sum of overlapping time 2.65s
277}
278
279sub _traverse_keyword_additionalItems { shift->traverse_subschema(@_) }
280
281sub _eval_keyword_additionalItems ($self, $data, $schema, $state) {
282 return 1 if not exists $state->{_last_items_index};
283 return $self->_eval_keyword__items_schema($data, $schema, $state);
284}
285
286# prefixItems (draft 2020-12), array-based items (all drafts)
287sub _eval_keyword__items_array_schemas ($self, $data, $schema, $state) {
288 return 1 if not is_type('array', $data);
289 return 1 if ($state->{_last_items_index}//-1) == $data->$#*;
290
291 my @orig_annotations = $state->{annotations}->@*;
292 my @new_annotations;
293 my $valid = 1;
294
295 foreach my $idx (0 .. $data->$#*) {
296 last if $idx > $schema->{$state->{keyword}}->$#*;
297 $state->{_last_items_index} = $idx;
298
299 my @annotations = @orig_annotations;
300 if (is_type('boolean', $schema->{$state->{keyword}}[$idx])) {
301 next if $schema->{$state->{keyword}}[$idx];
302 $valid = E({ %$state, data_path => $state->{data_path}.'/'.$idx,
303 _schema_path_suffix => $idx }, 'item not permitted');
304 }
305 elsif ($self->eval($data->[$idx], $schema->{$state->{keyword}}[$idx],
306 +{ %$state, annotations => \@annotations,
307 data_path => $state->{data_path}.'/'.$idx,
308 schema_path => $state->{schema_path}.'/'.$state->{keyword}.'/'.$idx })) {
309 push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
310 next;
311 }
312
313 $valid = 0;
314 last if $state->{short_circuit} and not exists $schema->{
315 $state->{keyword} eq 'prefixItems' ? 'items'
316 : $state->{keyword} eq 'items' ? 'additionalItems' : die
317 };
318 }
319
320 push $state->{annotations}->@*, @new_annotations;
321 A($state, $state->{_last_items_index} == $data->$#* ? true : $state->{_last_items_index});
322 return E($state, 'not all items are valid') if not $valid;
323 return 1;
324}
325
326# schema-based items (all drafts), and additionalItems (up to and including draft2019-09)
32787902.41ms
# spent 23.8s (52.5ms+23.8) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema which was called 1758 times, avg 13.6ms/call: # 1758 times (52.5ms+23.8s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items at line 276, avg 13.6ms/call
sub _eval_keyword__items_schema ($self, $data, $schema, $state) {
32817585.57ms17585.85ms return 1 if not is_type('array', $data);
# spent 5.85ms making 1758 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call
329643848µs return 1 if ($state->{_last_items_index}//-1) == $data->$#*;
330
331643467µs my @orig_annotations = $state->{annotations}->@*;
332643118µs my @new_annotations;
333643187µs my $valid = 1;
334
3356432.18ms foreach my $idx (($state->{_last_items_index}//-1)+1 .. $data->$#*) {
33616322.46ms163212.7ms if (is_type('boolean', $schema->{$state->{keyword}})) {
# spent 12.7ms making 1632 calls to JSON::Schema::Modern::Utilities::is_type, avg 8µs/call
337189306µs189159µs next if $schema->{$state->{keyword}};
# spent 159µs making 189 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 841ns/call
338 $valid = E({ %$state, data_path => $state->{data_path}.'/'.$idx },
339 '%sitem not permitted',
340 exists $schema->{prefixItems} || $state->{keyword} eq 'additionalItems' ? 'additional ' : '');
341 }
342 else {
3431443744µs my @annotations = @orig_annotations;
344144317.2ms14430s if ($self->eval($data->[$idx], $schema->{$state->{keyword}},
# spent 26.3s making 1443 calls to JSON::Schema::Modern::Vocabulary::eval, avg 18.2ms/call, recursion: max depth 33, sum of overlapping time 26.3s
345 +{ %$state, annotations => \@annotations,
346 data_path => $state->{data_path}.'/'.$idx,
347 schema_path => $state->{schema_path}.'/'.$state->{keyword} })) {
34814431.90ms push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
34914436.96ms next;
350 }
351
352 $valid = 0;
353 }
354 last if $state->{short_circuit};
355 }
356
357643923µs $state->{_last_items_index} = $data->$#*;
358
3596431.82ms push $state->{annotations}->@*, @new_annotations;
360643948µs643164ms A($state, true);
# spent 164ms making 643 calls to JSON::Schema::Modern::Utilities::A, avg 255µs/call
361 return E($state, 'subschema is not valid against all %sitems',
362643327µs $state->{keyword} eq 'additionalItems' ? 'additional ' : '') if not $valid;
3636432.72ms return 1;
364}
365
366317µs3275µs
# spent 6.74ms (17µs+6.72) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains which was called 3 times, avg 2.25ms/call: # 3 times (17µs+6.72ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 2.25ms/call
sub _traverse_keyword_contains { shift->traverse_subschema(@_) }
# spent 6.72ms making 3 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 2.24ms/call, recursion: max depth 1, sum of overlapping time 6.45ms
367
368sub _eval_keyword_contains ($self, $data, $schema, $state) {
369 return 1 if not is_type('array', $data);
370
371 $state->{_num_contains} = 0;
372 my @orig_annotations = $state->{annotations}->@*;
373 my (@errors, @new_annotations, @valid);
374 foreach my $idx (0 .. $data->$#*) {
375 my @annotations = @orig_annotations;
376 if ($self->eval($data->[$idx], $schema->{contains},
377 +{ %$state, errors => \@errors, annotations => \@annotations,
378 data_path => $state->{data_path}.'/'.$idx,
379 schema_path => $state->{schema_path}.'/contains' })) {
380 ++$state->{_num_contains};
381 push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
382 push @valid, $idx;
383
384 last if $state->{short_circuit}
385 and (not exists $schema->{maxContains} or $state->{_num_contains} > $schema->{maxContains})
386 and ($state->{_num_contains} >= ($schema->{minContains}//1));
387 }
388 }
389
390 # note: no items contained is only valid when minContains is explicitly 0
391 if (not $state->{_num_contains}
392 and (($schema->{minContains}//1) > 0 or $state->{spec_version} eq 'draft7')) {
393 push $state->{errors}->@*, @errors;
394 return E($state, 'subschema is not valid against any item');
395 }
396
397 push $state->{annotations}->@*, @new_annotations;
398 return $state->{spec_version} =~ /^draft(?:7|2019-09)$/ ? 1
399 : A($state, @valid == @$data ? true : \@valid);
400}
401
4023871.36ms387286ms
# spent 325ms (1.40+324) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties which was called 387 times, avg 841µs/call: # 387 times (1.40ms+324ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 841µs/call
sub _traverse_keyword_properties { shift->traverse_object_schemas(@_) }
# spent 358ms making 387 calls to JSON::Schema::Modern::Vocabulary::traverse_object_schemas, avg 926µs/call, recursion: max depth 3, sum of overlapping time 72.3ms
403
40416246035.9ms
# spent 97.0s (857ms+96.2) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties which was called 32492 times, avg 2.99ms/call: # 32492 times (857ms+96.2s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 2.99ms/call
sub _eval_keyword_properties ($self, $data, $schema, $state) {
4053249261.8ms32492100ms return 1 if not is_type('object', $data);
# spent 100ms making 32492 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call
406
407286126.55ms my $valid = 1;
4082861229.0ms my @orig_annotations = $state->{annotations}->@*;
409286127.42ms my (@properties, @new_annotations);
41028612198ms2861250.7ms foreach my $property (sort keys $schema->{properties}->%*) {
# spent 50.7ms making 28612 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 2µs/call
41116499140.2ms next if not exists $data->{$property};
412105878.07ms push @properties, $property;
413
4141058716.1ms1058790.5ms if (is_type('boolean', $schema->{properties}{$property})) {
# spent 90.5ms making 10587 calls to JSON::Schema::Modern::Utilities::is_type, avg 9µs/call
415145513µs145347µs next if $schema->{properties}{$property};
# spent 347µs making 145 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 2µs/call
416 $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property),
417 _schema_path_suffix => $property }, 'property not permitted');
418 }
419 else {
420104426.02ms my @annotations = @orig_annotations;
42110442142ms3132697.1s if ($self->eval($data->{$property}, $schema->{properties}{$property},
# spent 382s making 10442 calls to JSON::Schema::Modern::Vocabulary::eval, avg 36.6ms/call, recursion: max depth 33, sum of overlapping time 285s # spent 139ms making 20884 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call
422 +{ %$state, annotations => \@annotations,
423 data_path => jsonp($state->{data_path}, $property),
424 schema_path => jsonp($state->{schema_path}, 'properties', $property) })) {
425964329.3ms push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
426964353.6ms next;
427 }
428
429799532µs $valid = 0;
430 }
431799496µs last if $state->{short_circuit};
432 }
433
4342861235.6ms push $state->{annotations}->@*, @new_annotations;
4352861245.9ms286127.20s A($state, \@properties);
# spent 7.20s making 28612 calls to JSON::Schema::Modern::Utilities::A, avg 252µs/call
4362861213.3ms799211ms return E($state, 'not all properties are valid') if not $valid;
# spent 211ms making 799 calls to JSON::Schema::Modern::Utilities::E, avg 264µs/call
4372781389.4ms return 1;
438}
439
440285µs
# spent 1.82ms (136µs+1.68) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties which was called 7 times, avg 260µs/call: # 7 times (136µs+1.68ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 260µs/call
sub _traverse_keyword_patternProperties ($self, $schema, $state) {
441713µs740µs return if not assert_keyword_type($state, $schema, 'object');
# spent 40µs making 7 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 6µs/call
442
44370s my $valid = 1;
444725µs72µs foreach my $property (sort keys $schema->{patternProperties}->%*) {
# spent 2µs making 7 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 286ns/call
445748µs7312µs $valid = 0 if not assert_pattern({ %$state, _schema_path_suffix => $property }, $property);
# spent 312µs making 7 calls to JSON::Schema::Modern::Utilities::assert_pattern, avg 45µs/call
446720µs71.33ms $valid = 0 if not $self->traverse_property_schema($schema, $state, $property);
# spent 1.33ms making 7 calls to JSON::Schema::Modern::Vocabulary::traverse_property_schema, avg 190µs/call
447 }
448714µs return $valid;
449}
450
451180805.00ms
# spent 80.3s (220ms+80.1) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties which was called 3616 times, avg 22.2ms/call: # 3616 times (220ms+80.1s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 22.2ms/call
sub _eval_keyword_patternProperties ($self, $data, $schema, $state) {
45236166.48ms361611.1ms return 1 if not is_type('object', $data);
# spent 11.1ms making 3616 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call
453
45436161.64ms my $valid = 1;
45536163.67ms my @orig_annotations = $state->{annotations}->@*;
45636161.08ms my (@properties, @new_annotations);
457361615.3ms36161.99ms foreach my $property_pattern (sort keys $schema->{patternProperties}->%*) {
# spent 1.99ms making 3616 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 550ns/call
4583616112ms2161651.2ms foreach my $property (sort grep m/$property_pattern/, keys %$data) {
# spent 45.1ms making 9000 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp, avg 5µs/call # spent 4.87ms making 9000 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:match, avg 541ns/call # spent 1.30ms making 3616 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 360ns/call
45922691.23ms push @properties, $property;
46022693.83ms226921.9ms if (is_type('boolean', $schema->{patternProperties}{$property_pattern})) {
# spent 21.9ms making 2269 calls to JSON::Schema::Modern::Utilities::is_type, avg 10µs/call
46110612.20ms10611.30ms next if $schema->{patternProperties}{$property_pattern};
# spent 1.30ms making 1061 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 1µs/call
462 $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property),
463 _schema_path_suffix => $property_pattern }, 'property not permitted');
464 }
465 else {
46612084.93ms my @annotations = @orig_annotations;
467120820.9ms362418.1ms if ($self->eval($data->{$property}, $schema->{patternProperties}{$property_pattern},
# spent 18.1ms making 2416 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call # spent 184s making 1208 calls to JSON::Schema::Modern::Vocabulary::eval, avg 152ms/call, recursion: max depth 4, sum of overlapping time 184s
468 +{ %$state, annotations => \@annotations,
469 data_path => jsonp($state->{data_path}, $property),
470 schema_path => jsonp($state->{schema_path}, 'patternProperties', $property_pattern) })) {
47112087.27ms push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
472120813.6ms next;
473 }
474
475 $valid = 0;
476 }
477 last if $state->{short_circuit};
478 }
479 }
480
481361630.5ms push $state->{annotations}->@*, @new_annotations;
482361621.3ms7232998ms A($state, [ uniqstr @properties ]);
# spent 991ms making 3616 calls to JSON::Schema::Modern::Utilities::A, avg 274µs/call # spent 6.75ms making 3616 calls to List::Util::uniqstr, avg 2µs/call
4833616954µs return E($state, 'not all properties are valid') if not $valid;
484361617.9ms return 1;
485}
486
487130696µs13030.9ms
# spent 32.1ms (642µs+31.5) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties which was called 130 times, avg 247µs/call: # 130 times (642µs+31.5ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 247µs/call
sub _traverse_keyword_additionalProperties { shift->traverse_subschema(@_) }
# spent 38.8ms making 130 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 298µs/call, recursion: max depth 2, sum of overlapping time 7.88ms
488
48948851.19ms
# spent 67.2s (82.9ms+67.1) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties which was called 977 times, avg 68.8ms/call: # 977 times (82.9ms+67.1s) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 68.8ms/call
sub _eval_keyword_additionalProperties ($self, $data, $schema, $state) {
4909771.45ms9772.43ms return 1 if not is_type('object', $data);
# spent 2.43ms making 977 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call
491
492977363µs my $valid = 1;
493977774µs my @orig_annotations = $state->{annotations}->@*;
494977329µs my (@properties, @new_annotations);
4959776.78ms977718µs foreach my $property (sort keys %$data) {
# spent 718µs making 977 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 735ns/call
49618351.16ms next if exists $schema->{properties} and exists $schema->{properties}{$property};
497 next if exists $schema->{patternProperties}
4981835790µs and any { $property =~ /$_/ } keys $schema->{patternProperties}->%*;
499
50018351.55ms push @properties, $property;
50118352.45ms183515.6ms if (is_type('boolean', $schema->{additionalProperties})) {
# spent 15.6ms making 1835 calls to JSON::Schema::Modern::Utilities::is_type, avg 9µs/call
502 next if $schema->{additionalProperties};
503 $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property) },
504 'additional property not permitted');
505 }
506 else {
5071835808µs my @annotations = @orig_annotations;
508183529.1ms367014.2ms if ($self->eval($data->{$property}, $schema->{additionalProperties},
# spent 14.2ms making 1835 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call # spent 108s making 1835 calls to JSON::Schema::Modern::Vocabulary::eval, avg 58.6ms/call, recursion: max depth 30, sum of overlapping time 108s
509 +{ %$state, annotations => \@annotations,
510 data_path => jsonp($state->{data_path}, $property),
511 schema_path => $state->{schema_path}.'/additionalProperties' })) {
51218356.02ms push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
513183510.4ms next;
514 }
515
516 $valid = 0;
517 }
518 last if $state->{short_circuit};
519 }
520
5219776.84ms push $state->{annotations}->@*, @new_annotations;
5229771.46ms977231ms A($state, \@properties);
# spent 231ms making 977 calls to JSON::Schema::Modern::Utilities::A, avg 237µs/call
523977513µs return E($state, 'not all additional properties are valid') if not $valid;
5249775.37ms return 1;
525}
526
5271457µs143.49ms
# spent 3.63ms (66µs+3.56) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames which was called 14 times, avg 259µs/call: # 14 times (66µs+3.56ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 259µs/call
sub _traverse_keyword_propertyNames { shift->traverse_subschema(@_) }
# spent 3.56ms making 14 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 254µs/call, recursion: max depth 1, sum of overlapping time 66µs
528
5293135981µs
# spent 496ms (24.1+472) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames which was called 627 times, avg 791µs/call: # 627 times (24.1ms+472ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 791µs/call
sub _eval_keyword_propertyNames ($self, $data, $schema, $state) {
530627956µs6271.74ms return 1 if not is_type('object', $data);
# spent 1.74ms making 627 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call
531
532627243µs my $valid = 1;
533627992µs my @orig_annotations = $state->{annotations}->@*;
534627156µs my @new_annotations;
5356273.26ms627311µs foreach my $property (sort keys %$data) {
# spent 311µs making 627 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 496ns/call
5367131.02ms my @annotations = @orig_annotations;
5377138.73ms142617.1ms if ($self->eval($property, $schema->{propertyNames},
# spent 17.1ms making 713 calls to JSON::Schema::Modern::Utilities::jsonp, avg 24µs/call # spent 453ms making 713 calls to JSON::Schema::Modern::Vocabulary::eval, avg 635µs/call, recursion: max depth 7, sum of overlapping time 453ms
538 +{ %$state, annotations => \@annotations,
539 data_path => jsonp($state->{data_path}, $property),
540 schema_path => $state->{schema_path}.'/propertyNames' })) {
541713514µs push @new_annotations, @annotations[$#orig_annotations+1 .. $#annotations];
5427133.15ms next;
543 }
544
545 $valid = 0;
546 last if $state->{short_circuit};
547 }
548
549627629µs push $state->{annotations}->@*, @new_annotations;
550627141µs return E($state, 'not all property names are valid') if not $valid;
5516272.60ms return 1;
552}
553
55417µs1;
555
556131µs1334µs__END__
 
# spent 129ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:match which was called 197150 times, avg 657ns/call: # 188150 times (125ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 662ns/call # 9000 times (4.87ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 458, avg 541ns/call
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:match; # opcode
# spent 162ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr which was called 188150 times, avg 862ns/call: # 188150 times (162ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 862ns/call
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr; # opcode
# spent 233ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp which was called 197150 times, avg 1µs/call: # 188150 times (187ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 996ns/call # 9000 times (45.1ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 458, avg 5µs/call
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp; # opcode
# spent 55.2ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort which was called 37760 times, avg 1µs/call: # 28612 times (50.7ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties at line 410, avg 2µs/call # 3616 times (1.99ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 457, avg 550ns/call # 3616 times (1.30ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 458, avg 360ns/call # 977 times (718µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties at line 495, avg 735ns/call # 627 times (311µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames at line 535, avg 496ns/call # 305 times (156µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas at line 177, avg 511ns/call # 7 times (2µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties at line 444, avg 286ns/call
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort; # opcode
# spent 0s within JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ which was called: # once (0s+0s) by JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21 at line 21
sub JSON::Schema::Modern::Vocabulary::Applicator::__ANON__; # xsub