Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Vocabulary/Applicator.pm |
Statements | Executed 814653 statements in 1.76s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
32492 | 1 | 1 | 815ms | 87.1s | _eval_keyword_properties (recurses: max depth 11, inclusive time 326s) | JSON::Schema::Modern::Vocabulary::Applicator::
6002 | 1 | 1 | 478ms | 64.9s | _eval_keyword_allOf (recurses: max depth 13, inclusive time 175s) | JSON::Schema::Modern::Vocabulary::Applicator::
3369 | 1 | 1 | 149ms | 72.9s | _eval_keyword_patternProperties (recurses: max depth 2, inclusive time 31.9s) | JSON::Schema::Modern::Vocabulary::Applicator::
3013 | 1 | 1 | 102ms | 66.2s | _eval_keyword_if (recurses: max depth 1, inclusive time 3.74s) | JSON::Schema::Modern::Vocabulary::Applicator::
977 | 1 | 1 | 69.3ms | 60.9s | _eval_keyword_additionalProperties (recurses: max depth 4, inclusive time 37.4s) | JSON::Schema::Modern::Vocabulary::Applicator::
37265 | 7 | 1 | 58.2ms | 58.2ms | CORE:sort (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
1758 | 1 | 1 | 51.5ms | 21.9s | _eval_keyword__items_schema (recurses: max depth 4, inclusive time 2.33s) | JSON::Schema::Modern::Vocabulary::Applicator::
1182 | 1 | 1 | 50.4ms | 3.34s | _eval_keyword_anyOf | JSON::Schema::Modern::Vocabulary::Applicator::
8340 | 2 | 1 | 31.8ms | 31.8ms | CORE:regcomp (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
627 | 1 | 1 | 21.0ms | 372ms | _eval_keyword_propertyNames | JSON::Schema::Modern::Vocabulary::Applicator::
1758 | 1 | 1 | 14.4ms | 21.9s | _eval_keyword_items (recurses: max depth 4, inclusive time 2.33s) | JSON::Schema::Modern::Vocabulary::Applicator::
305 | 1 | 1 | 12.5ms | 316ms | _eval_keyword_oneOf | JSON::Schema::Modern::Vocabulary::Applicator::
305 | 1 | 1 | 8.18ms | 4.04s | _eval_keyword_dependentSchemas | JSON::Schema::Modern::Vocabulary::Applicator::
8340 | 2 | 1 | 4.51ms | 4.51ms | CORE:match (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 2.15ms | 2.39ms | BEGIN@19 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 2.06ms | 4.54ms | BEGIN@21 | JSON::Schema::Modern::Vocabulary::Applicator::
387 | 1 | 1 | 1.99ms | 291ms | _traverse_keyword_properties (recurses: max depth 3, inclusive time 27.7ms) | JSON::Schema::Modern::Vocabulary::Applicator::
98 | 1 | 1 | 916µs | 90.7ms | _traverse_keyword_items (recurses: max depth 1, inclusive time 4.14ms) | JSON::Schema::Modern::Vocabulary::Applicator::
130 | 1 | 1 | 759µs | 28.3ms | _traverse_keyword_additionalProperties (recurses: max depth 1, inclusive time 6.53ms) | JSON::Schema::Modern::Vocabulary::Applicator::
65 | 1 | 1 | 243µs | 11.9ms | _traverse_keyword_if | JSON::Schema::Modern::Vocabulary::Applicator::
65 | 1 | 1 | 243µs | 19.4ms | _traverse_keyword_then | JSON::Schema::Modern::Vocabulary::Applicator::
32 | 1 | 1 | 133µs | 15.1ms | _traverse_keyword_anyOf (recurses: max depth 1, inclusive time 137µs) | JSON::Schema::Modern::Vocabulary::Applicator::
4 | 1 | 1 | 130µs | 3.22ms | _eval_keyword_not | JSON::Schema::Modern::Vocabulary::Applicator::
6 | 1 | 1 | 130µs | 1.28ms | _traverse_keyword_patternProperties | JSON::Schema::Modern::Vocabulary::Applicator::
23 | 1 | 1 | 111µs | 22.3ms | _traverse_keyword_allOf | JSON::Schema::Modern::Vocabulary::Applicator::
21 | 1 | 1 | 93µs | 12.6ms | _traverse_keyword_oneOf | JSON::Schema::Modern::Vocabulary::Applicator::
15 | 1 | 1 | 89µs | 1.78ms | _traverse_keyword_not | JSON::Schema::Modern::Vocabulary::Applicator::
14 | 1 | 1 | 69µs | 3.71ms | _traverse_keyword_propertyNames | JSON::Schema::Modern::Vocabulary::Applicator::
15 | 1 | 1 | 59µs | 3.05ms | _traverse_keyword_else | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 53µs | 55µs | BEGIN@1.307 | Module::Runtime::
2 | 2 | 1 | 41µs | 58µs | keywords | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 26µs | 690µs | BEGIN@11 | JSON::Schema::Modern::Vocabulary::Applicator::
3 | 1 | 1 | 22µs | 6.96ms | _traverse_keyword_contains | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 15µs | 54µs | BEGIN@17 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 15µs | 27µs | BEGIN@18 | JSON::Schema::Modern::Vocabulary::Applicator::
3 | 1 | 1 | 14µs | 7.44ms | _traverse_keyword_dependentSchemas | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 11µs | 32µs | BEGIN@13 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 10µs | 10µs | BEGIN@9 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 9µs | 20µs | BEGIN@14 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 9µs | 20µs | BEGIN@15 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 8µs | 292µs | BEGIN@22 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 7µs | 183µs | BEGIN@10 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 7µs | 84µs | BEGIN@12 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 7µs | 84µs | BEGIN@20 | JSON::Schema::Modern::Vocabulary::Applicator::
4 | 1 | 1 | 6µs | 6µs | CORE:qr (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 6µs | 38µs | BEGIN@2.308 | Module::Runtime::
1 | 1 | 1 | 5µs | 12µs | BEGIN@16 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 3µs | 3µs | vocabulary | JSON::Schema::Modern::Vocabulary::Applicator::
4 | 1 | 1 | 2µs | 2µs | evaluation_order | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 0s | 0s | __ANON__ (xsub) | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | __ANON__[:448] | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | __ANON__[:63] | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _eval_keyword__items_array_schemas | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _eval_keyword_additionalItems | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _eval_keyword_contains | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _eval_keyword_dependencies | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _eval_keyword_prefixItems | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _traverse_keyword_additionalItems | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _traverse_keyword_dependencies | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | _traverse_keyword_prefixItems | JSON::Schema::Modern::Vocabulary::Applicator::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 50µs | 2 | 57µs | # spent 55µs (53+2) within Module::Runtime::BEGIN@1.307 which was called:
# once (53µs+2µs) by Module::Runtime::require_module at line 1 # spent 55µs making 1 call to Module::Runtime::BEGIN@1.307
# spent 2µs making 1 call to strict::import |
2 | 2 | 37µs | 2 | 70µs | # spent 38µs (6+32) within Module::Runtime::BEGIN@2.308 which was called:
# once (6µs+32µs) by Module::Runtime::require_module at line 2 # spent 38µs making 1 call to Module::Runtime::BEGIN@2.308
# spent 32µs making 1 call to warnings::import |
3 | package 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 | |||||
7 | 1 | 0s | our $VERSION = '0.558'; | ||
8 | |||||
9 | 2 | 27µs | 1 | 10µs | # spent 10µs within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9 which was called:
# once (10µs+0s) by Module::Runtime::require_module at line 9 # spent 10µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9 |
10 | 2 | 25µs | 2 | 359µs | # spent 183µs (7+176) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10 which was called:
# once (7µs+176µs) by Module::Runtime::require_module at line 10 # spent 183µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10
# spent 176µs making 1 call to Moo::import |
11 | 3 | 46µs | 3 | 1.35ms | # spent 690µs (26+664) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11 which was called:
# once (26µs+664µs) by Module::Runtime::require_module at line 11 # spent 690µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11
# spent 613µs making 1 call to strictures::import
# spent 51µs making 1 call to strictures::VERSION |
12 | 2 | 33µs | 2 | 161µs | # spent 84µs (7+77) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12 which was called:
# once (7µs+77µs) by Module::Runtime::require_module at line 12 # spent 84µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12
# spent 77µs making 1 call to experimental::import |
13 | 2 | 24µs | 2 | 35µs | # spent 32µs (11+21) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13 which was called:
# once (11µs+21µs) by Module::Runtime::require_module at line 13 # spent 32µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13
# spent 3µs making 1 call to if::import |
14 | 2 | 18µs | 2 | 22µs | # spent 20µs (9+11) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14 which was called:
# once (9µs+11µs) by Module::Runtime::require_module at line 14 # spent 20µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14
# spent 2µs making 1 call to if::unimport |
15 | 2 | 17µs | 2 | 21µs | # spent 20µs (9+11) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15 which was called:
# once (9µs+11µs) by Module::Runtime::require_module at line 15 # spent 20µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15
# spent 1µs making 1 call to if::unimport |
16 | 2 | 17µs | 2 | 13µs | # spent 12µs (5+7) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16 which was called:
# once (5µs+7µs) by Module::Runtime::require_module at line 16 # spent 12µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16
# spent 1µs making 1 call to if::unimport |
17 | 3 | 30µs | 3 | 68µs | # spent 54µs (15+39) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17 which was called:
# once (15µs+39µs) by Module::Runtime::require_module at line 17 # spent 54µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17
# spent 9µs making 1 call to List::Util::import
# spent 5µs making 1 call to UNIVERSAL::VERSION |
18 | 3 | 29µs | 3 | 39µs | # spent 27µs (15+12) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18 which was called:
# once (15µs+12µs) by Module::Runtime::require_module at line 18 # spent 27µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18
# spent 8µs making 1 call to Exporter::import
# spent 4µs making 1 call to UNIVERSAL::VERSION |
19 | 2 | 804µs | 2 | 2.39ms | # spent 2.39ms (2.15+243µs) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19 which was called:
# once (2.15ms+243µs) by Module::Runtime::require_module at line 19 # spent 2.39ms making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19
# spent 1µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:270] |
20 | 2 | 27µs | 2 | 161µs | # spent 84µs (7+77) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20 which was called:
# once (7µs+77µs) by Module::Runtime::require_module at line 20 # spent 84µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20
# spent 77µs making 1 call to Exporter::import |
21 | 2 | 396µs | 2 | 4.54ms | # spent 4.54ms (2.06+2.48) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21 which was called:
# once (2.06ms+2.48ms) by Module::Runtime::require_module at line 21 # spent 4.54ms making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21
# spent 0s making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ |
22 | 2 | 4.89ms | 2 | 576µs | # spent 292µs (8+284) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22 which was called:
# once (8µs+284µs) by Module::Runtime::require_module at line 22 # spent 292µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22
# spent 284µs making 1 call to namespace::clean::import |
23 | |||||
24 | 1 | 9µs | 1 | 688µs | with 'JSON::Schema::Modern::Vocabulary'; # spent 688µ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:700] at line 696 of JSON/Schema/Modern.pm | ||||
27 | 1 | 4µ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 | |||||
31 | 4 | 22µs | # spent 2µs within JSON::Schema::Modern::Vocabulary::Applicator::evaluation_order which was called 4 times, avg 500ns/call:
# 4 times (2µs+0s) by JSON::Schema::Modern::Vocabulary::Core::CORE:sort at line 331 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 500ns/call | ||
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) | ||||
42 | 6 | 1µs | # spent 58µs (41+17) within JSON::Schema::Modern::Vocabulary::Applicator::keywords which was called 2 times, avg 29µs/call:
# once (29µs+11µs) by JSON::Schema::Modern::_traverse_subschema at line 475 of JSON/Schema/Modern.pm
# once (12µs+6µs) by JSON::Schema::Modern::_eval_subschema at line 563 of JSON/Schema/Modern.pm | ||
43 | return ( | ||||
44 | 2 | 59µs | 12 | 17µs | qw(allOf anyOf oneOf not if then else), # spent 6µs making 4 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr, avg 2µs/call
# spent 6µs making 4 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp, avg 2µs/call
# spent 5µs making 4 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:match, avg 1µs/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 | ||||
55 | 1 | 0s | foreach my $phase (qw(traverse eval)) { | ||
56 | 2 | 2µs | foreach my $type (qw(Items Properties)) { | ||
57 | 4 | 2µ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 | } | ||||
64 | 4 | 16µs | 4 | 148µs | }), # spent 148µs making 4 calls to Sub::Install::__ANON__[Sub/Install.pm:118], avg 37µs/call |
65 | } | ||||
66 | } | ||||
67 | |||||
68 | 23 | 86µs | 23 | 21.5ms | # spent 22.3ms (111µs+22.2) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf which was called 23 times, avg 970µs/call:
# 23 times (111µs+22.2ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 970µs/call # spent 22.2ms making 23 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 965µs/call, recursion: max depth 1, sum of overlapping time 731µs |
69 | |||||
70 | 30010 | 7.60ms | # spent 64.9s (478ms+64.4) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf which was called 6002 times, avg 10.8ms/call:
# 6002 times (478ms+64.4s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 10.8ms/call | ||
71 | 6002 | 1.47ms | my @invalid; | ||
72 | 6002 | 13.2ms | foreach my $idx (0 .. $schema->{allOf}->$#*) { | ||
73 | 25750 | 408ms | 25750 | 0s | if ($self->eval($data, $schema->{allOf}[$idx], +{ %$state, # spent 240s making 25750 calls to JSON::Schema::Modern::Vocabulary::eval, avg 9.31ms/call, recursion: max depth 32, sum of overlapping time 240s |
74 | schema_path => $state->{schema_path}.'/allOf/'.$idx })) { | ||||
75 | } | ||||
76 | else { | ||||
77 | push @invalid, $idx; | ||||
78 | last if $state->{short_circuit}; | ||||
79 | } | ||||
80 | } | ||||
81 | |||||
82 | 6002 | 21.7ms | return 1 if @invalid == 0; | ||
83 | |||||
84 | my $pl = @invalid > 1; | ||||
85 | return E($state, 'subschema%s %s %s not valid', $pl?'s':'', join(', ', @invalid), $pl?'are':'is'); | ||||
86 | } | ||||
87 | |||||
88 | 32 | 143µs | 32 | 14.2ms | # spent 15.1ms (133µs+14.9) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf which was called 32 times, avg 470µs/call:
# 32 times (133µs+14.9ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 470µs/call # spent 15.1ms making 32 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 471µs/call, recursion: max depth 2, sum of overlapping time 840µs |
89 | |||||
90 | 5910 | 2.06ms | # spent 3.34s (50.4ms+3.29) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf which was called 1182 times, avg 2.82ms/call:
# 1182 times (50.4ms+3.29s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 2.82ms/call | ||
91 | 1182 | 384µs | my $valid = 0; | ||
92 | 1182 | 305µs | my @errors; | ||
93 | 1182 | 3.67ms | foreach my $idx (0 .. $schema->{anyOf}->$#*) { | ||
94 | next if not $self->eval($data, $schema->{anyOf}[$idx], | ||||
95 | 2365 | 33.5ms | 2365 | 4.49ms | +{ %$state, errors => \@errors, schema_path => $state->{schema_path}.'/anyOf/'.$idx }); # spent 3.29s making 2365 calls to JSON::Schema::Modern::Vocabulary::eval, avg 1.39ms/call, recursion: max depth 34, sum of overlapping time 3.28s |
96 | 1183 | 557µs | ++$valid; | ||
97 | 1183 | 1.36ms | last if $state->{short_circuit}; | ||
98 | } | ||||
99 | |||||
100 | 1182 | 6.69ms | return 1 if $valid; | ||
101 | push $state->{errors}->@*, @errors; | ||||
102 | return E($state, 'no subschemas are valid'); | ||||
103 | } | ||||
104 | |||||
105 | 21 | 73µs | 21 | 12.6ms | # spent 12.6ms (93µs+12.6) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf which was called 21 times, avg 602µs/call:
# 21 times (93µs+12.6ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 602µs/call # spent 12.6ms making 21 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 598µs/call |
106 | |||||
107 | 1525 | 360µs | # spent 316ms (12.5+303) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf which was called 305 times, avg 1.04ms/call:
# 305 times (12.5ms+303ms) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 1.04ms/call | ||
108 | 305 | 93µs | my (@valid, @errors); | ||
109 | 305 | 863µs | foreach my $idx (0 .. $schema->{oneOf}->$#*) { | ||
110 | next if not $self->eval($data, $schema->{oneOf}[$idx], | ||||
111 | 610 | 8.28ms | 610 | 0s | +{ %$state, errors => \@errors, schema_path => $state->{schema_path}.'/oneOf/'.$idx }); # spent 303ms making 610 calls to JSON::Schema::Modern::Vocabulary::eval, avg 497µs/call, recursion: max depth 9, sum of overlapping time 303ms |
112 | 305 | 219µs | push @valid, $idx; | ||
113 | 305 | 287µs | last if @valid > 1 and $state->{short_circuit}; | ||
114 | } | ||||
115 | |||||
116 | 305 | 1.99ms | return 1 if @valid == 1; | ||
117 | |||||
118 | if (not @valid) { | ||||
119 | push $state->{errors}->@*, @errors; | ||||
120 | return E($state, 'no subschemas are valid'); | ||||
121 | } | ||||
122 | else { | ||||
123 | return E($state, 'multiple subschemas are valid: '.join(', ', @valid)); | ||||
124 | } | ||||
125 | } | ||||
126 | |||||
127 | 15 | 108µs | 15 | 1.08ms | # spent 1.78ms (89µs+1.69) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not which was called 15 times, avg 118µs/call:
# 15 times (89µs+1.69ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 118µs/call # spent 1.69ms making 15 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 112µs/call, recursion: max depth 1, sum of overlapping time 606µs |
128 | |||||
129 | 20 | 49µs | # spent 3.22ms (130µs+3.09) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not which was called 4 times, avg 804µs/call:
# 4 times (130µs+3.09ms) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 804µs/call | ||
130 | return 1 if not $self->eval($data, $schema->{not}, | ||||
131 | +{ %$state, schema_path => $state->{schema_path}.'/not', | ||||
132 | short_circuit => $state->{short_circuit} || !$state->{collect_annotations}, | ||||
133 | 4 | 69µs | 4 | 0s | errors => [] }); # spent 3.09ms making 4 calls to JSON::Schema::Modern::Vocabulary::eval, avg 772µs/call, recursion: max depth 12, sum of overlapping time 3.09ms |
134 | |||||
135 | return E($state, 'subschema is valid'); | ||||
136 | } | ||||
137 | |||||
138 | 65 | 295µs | 65 | 10.1ms | # spent 11.9ms (243µs+11.6) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if which was called 65 times, avg 183µs/call:
# 65 times (243µs+11.6ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 183µs/call # spent 11.6ms making 65 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 179µs/call, recursion: max depth 2, sum of overlapping time 1.52ms |
139 | 65 | 228µs | 65 | 17.2ms | # spent 19.4ms (243µs+19.2) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then which was called 65 times, avg 299µs/call:
# 65 times (243µs+19.2ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 299µs/call # spent 19.2ms making 65 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 295µs/call, recursion: max depth 2, sum of overlapping time 2.02ms |
140 | 15 | 51µs | 15 | 2.99ms | # spent 3.05ms (59µs+2.99) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else which was called 15 times, avg 204µs/call:
# 15 times (59µs+2.99ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 204µs/call # spent 2.99ms making 15 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 200µs/call |
141 | |||||
142 | 15065 | 3.79ms | # spent 66.2s (102ms+66.1) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if which was called 3013 times, avg 22.0ms/call:
# 3013 times (102ms+66.1s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 22.0ms/call | ||
143 | return 1 if not exists $schema->{then} and not exists $schema->{else} | ||||
144 | 3013 | 1.35ms | and not $state->{collect_annotations}; | ||
145 | my $keyword = $self->eval($data, $schema->{if}, | ||||
146 | +{ %$state, schema_path => $state->{schema_path}.'/if', | ||||
147 | short_circuit => $state->{short_circuit} || !$state->{collect_annotations}, | ||||
148 | 3013 | 56.1ms | 3013 | 0s | errors => [], # spent 2.52s making 3013 calls to JSON::Schema::Modern::Vocabulary::eval, avg 838µs/call, recursion: max depth 11, sum of overlapping time 2.52s |
149 | }) | ||||
150 | ? 'then' : 'else'; | ||||
151 | |||||
152 | 3013 | 4.06ms | return 1 if not exists $schema->{$keyword}; | ||
153 | return 1 if $self->eval($data, $schema->{$keyword}, | ||||
154 | 2214 | 30.4ms | 2214 | 0s | +{ %$state, schema_path => $state->{schema_path}.'/'.$keyword }); # spent 67.3s making 2214 calls to JSON::Schema::Modern::Vocabulary::eval, avg 30.4ms/call, recursion: max depth 11, sum of overlapping time 67.3s |
155 | return E({ %$state, keyword => $keyword }, 'subschema is not valid'); | ||||
156 | } | ||||
157 | |||||
158 | 3 | 10µs | 3 | 0s | # spent 7.44ms (14µs+7.42) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas which was called 3 times, avg 2.48ms/call:
# 3 times (14µs+7.42ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 2.48ms/call # spent 7.42ms making 3 calls to JSON::Schema::Modern::Vocabulary::traverse_object_schemas, avg 2.47ms/call, recursion: max depth 1, sum of overlapping time 7.42ms |
159 | |||||
160 | 1525 | 334µs | # spent 4.04s (8.18ms+4.03) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas which was called 305 times, avg 13.3ms/call:
# 305 times (8.18ms+4.03s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 13.3ms/call | ||
161 | 305 | 439µs | 305 | 523µs | return 1 if not is_type('object', $data); # spent 523µs making 305 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call |
162 | |||||
163 | 305 | 134µs | my $valid = 1; | ||
164 | 305 | 1.44ms | 305 | 169µs | foreach my $property (sort keys $schema->{dependentSchemas}->%*) { # spent 169µs making 305 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 554ns/call |
165 | 305 | 110µs | next if not exists $data->{$property}; | ||
166 | |||||
167 | 290 | 2.69ms | 580 | 2.28ms | if ($self->eval($data, $schema->{dependentSchemas}{$property}, # spent 2.28ms making 290 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call
# spent 4.03s making 290 calls to JSON::Schema::Modern::Vocabulary::eval, avg 13.9ms/call, recursion: max depth 9, sum of overlapping time 4.03s |
168 | +{ %$state, schema_path => jsonp($state->{schema_path}, 'dependentSchemas', $property) })) { | ||||
169 | 290 | 1.35ms | next; | ||
170 | } | ||||
171 | |||||
172 | $valid = 0; | ||||
173 | last if $state->{short_circuit}; | ||||
174 | } | ||||
175 | |||||
176 | 305 | 83µs | return E($state, 'not all dependencies are satisfied') if not $valid; | ||
177 | 305 | 1.05ms | return 1; | ||
178 | } | ||||
179 | |||||
180 | sub _traverse_keyword_dependencies ($self, $schema, $state) { | ||||
181 | return if not assert_keyword_type($state, $schema, 'object'); | ||||
182 | |||||
183 | my $valid = 1; | ||||
184 | foreach my $property (sort keys $schema->{dependencies}->%*) { | ||||
185 | if (is_type('array', $schema->{dependencies}{$property})) { | ||||
186 | # as in dependentRequired | ||||
187 | |||||
188 | foreach my $index (0..$schema->{dependencies}{$property}->$#*) { | ||||
189 | $valid = E({ %$state, _schema_path_suffix => [ $property, $index ] }, 'element #%d is not a string', $index) | ||||
190 | if not is_type('string', $schema->{dependencies}{$property}[$index]); | ||||
191 | } | ||||
192 | |||||
193 | $valid = E({ %$state, _schema_path_suffix => $property }, 'elements are not unique') | ||||
194 | if not is_elements_unique($schema->{dependencies}{$property}); | ||||
195 | } | ||||
196 | else { | ||||
197 | # as in dependentSchemas | ||||
198 | $valid = 0 if not $self->traverse_property_schema($schema, $state, $property); | ||||
199 | } | ||||
200 | } | ||||
201 | return $valid; | ||||
202 | } | ||||
203 | |||||
204 | sub _eval_keyword_dependencies ($self, $data, $schema, $state) { | ||||
205 | return 1 if not is_type('object', $data); | ||||
206 | |||||
207 | my $valid = 1; | ||||
208 | foreach my $property (sort keys $schema->{dependencies}->%*) { | ||||
209 | next if not exists $data->{$property}; | ||||
210 | |||||
211 | if (is_type('array', $schema->{dependencies}{$property})) { | ||||
212 | # as in dependentRequired | ||||
213 | if (my @missing = grep !exists($data->{$_}), $schema->{dependencies}{$property}->@*) { | ||||
214 | $valid = E({ %$state, _schema_path_suffix => $property }, | ||||
215 | 'missing propert%s: %s', @missing > 1 ? 'ies' : 'y', join(', ', @missing)); | ||||
216 | } | ||||
217 | } | ||||
218 | else { | ||||
219 | # as in dependentSchemas | ||||
220 | if ($self->eval($data, $schema->{dependencies}{$property}, | ||||
221 | +{ %$state, schema_path => jsonp($state->{schema_path}, 'dependencies', $property) })) { | ||||
222 | next; | ||||
223 | } | ||||
224 | |||||
225 | $valid = 0; | ||||
226 | last if $state->{short_circuit}; | ||||
227 | } | ||||
228 | } | ||||
229 | |||||
230 | return E($state, 'not all dependencies are satisfied') if not $valid; | ||||
231 | return 1; | ||||
232 | } | ||||
233 | |||||
234 | sub _traverse_keyword_prefixItems { shift->traverse_array_schemas(@_) } | ||||
235 | |||||
236 | sub _eval_keyword_prefixItems { shift->_eval_keyword__items_array_schemas(@_) } | ||||
237 | |||||
238 | 392 | 78µs | # spent 90.7ms (916µs+89.8) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items which was called 98 times, avg 925µs/call:
# 98 times (916µs+89.8ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 925µs/call | ||
239 | 98 | 107µs | if (is_plain_arrayref($schema->{items})) { | ||
240 | return E($state, 'array form of "items" not supported in %s', $state->{spec_version}) | ||||
241 | if $state->{spec_version} !~ /^draft(?:7|2019-09)$/; | ||||
242 | |||||
243 | return $self->traverse_array_schemas($schema, $state); | ||||
244 | } | ||||
245 | |||||
246 | 98 | 617µs | 98 | 87.3ms | $self->traverse_subschema($schema, $state); # spent 93.9ms making 98 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 958µs/call, recursion: max depth 1, sum of overlapping time 6.64ms |
247 | } | ||||
248 | |||||
249 | 8790 | 2.74ms | # spent 21.9s (14.4ms+21.9) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items which was called 1758 times, avg 12.5ms/call:
# 1758 times (14.4ms+21.9s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 12.5ms/call | ||
250 | return $self->_eval_keyword__items_array_schemas($data, $schema, $state) | ||||
251 | 1758 | 1.31ms | if is_plain_arrayref($schema->{items}); | ||
252 | |||||
253 | 1758 | 8.35ms | 1758 | 21.9s | return $self->_eval_keyword__items_schema($data, $schema, $state); # spent 24.3s making 1758 calls to JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema, avg 13.8ms/call, recursion: max depth 4, sum of overlapping time 2.33s |
254 | } | ||||
255 | |||||
256 | sub _traverse_keyword_additionalItems { shift->traverse_subschema(@_) } | ||||
257 | |||||
258 | sub _eval_keyword_additionalItems ($self, $data, $schema, $state) { | ||||
259 | return 1 if not exists $state->{_last_items_index}; | ||||
260 | return $self->_eval_keyword__items_schema($data, $schema, $state); | ||||
261 | } | ||||
262 | |||||
263 | # prefixItems (draft 2020-12), array-based items (all drafts) | ||||
264 | sub _eval_keyword__items_array_schemas ($self, $data, $schema, $state) { | ||||
265 | return 1 if not is_type('array', $data); | ||||
266 | return 1 if ($state->{_last_items_index}//-1) == $data->$#*; | ||||
267 | |||||
268 | my $valid = 1; | ||||
269 | |||||
270 | foreach my $idx (0 .. $data->$#*) { | ||||
271 | last if $idx > $schema->{$state->{keyword}}->$#*; | ||||
272 | $state->{_last_items_index} = $idx; | ||||
273 | |||||
274 | if (is_type('boolean', $schema->{$state->{keyword}}[$idx])) { | ||||
275 | next if $schema->{$state->{keyword}}[$idx]; | ||||
276 | $valid = E({ %$state, data_path => $state->{data_path}.'/'.$idx, | ||||
277 | _schema_path_suffix => $idx }, 'item not permitted'); | ||||
278 | } | ||||
279 | elsif ($self->eval($data->[$idx], $schema->{$state->{keyword}}[$idx], | ||||
280 | +{ %$state, data_path => $state->{data_path}.'/'.$idx, | ||||
281 | schema_path => $state->{schema_path}.'/'.$state->{keyword}.'/'.$idx })) { | ||||
282 | next; | ||||
283 | } | ||||
284 | |||||
285 | $valid = 0; | ||||
286 | last if $state->{short_circuit} and not exists $schema->{ | ||||
287 | $state->{keyword} eq 'prefixItems' ? 'items' | ||||
288 | : $state->{keyword} eq 'items' ? 'additionalItems' : die | ||||
289 | }; | ||||
290 | } | ||||
291 | |||||
292 | A($state, $state->{_last_items_index} == $data->$#* ? true : $state->{_last_items_index}); | ||||
293 | return E($state, 'not all items are valid') if not $valid; | ||||
294 | return 1; | ||||
295 | } | ||||
296 | |||||
297 | # schema-based items (all drafts), and additionalItems (up to and including draft2019-09) | ||||
298 | 8790 | 2.17ms | # spent 21.9s (51.5ms+21.9) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema which was called 1758 times, avg 12.5ms/call:
# 1758 times (51.5ms+21.9s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items at line 253, avg 12.5ms/call | ||
299 | 1758 | 6.95ms | 1758 | 8.20ms | return 1 if not is_type('array', $data); # spent 8.20ms making 1758 calls to JSON::Schema::Modern::Utilities::is_type, avg 5µs/call |
300 | 643 | 848µs | return 1 if ($state->{_last_items_index}//-1) == $data->$#*; | ||
301 | |||||
302 | 643 | 162µs | my $valid = 1; | ||
303 | |||||
304 | 643 | 2.66ms | foreach my $idx (($state->{_last_items_index}//-1)+1 .. $data->$#*) { | ||
305 | 1632 | 3.14ms | 1632 | 14.0ms | if (is_type('boolean', $schema->{$state->{keyword}})) { # spent 14.0ms making 1632 calls to JSON::Schema::Modern::Utilities::is_type, avg 9µs/call |
306 | 189 | 446µs | 189 | 175µs | next if $schema->{$state->{keyword}}; # spent 175µs making 189 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 926ns/call |
307 | $valid = E({ %$state, data_path => $state->{data_path}.'/'.$idx }, | ||||
308 | '%sitem not permitted', | ||||
309 | exists $schema->{prefixItems} || $state->{keyword} eq 'additionalItems' ? 'additional ' : ''); | ||||
310 | } | ||||
311 | else { | ||||
312 | 1443 | 26.2ms | 1443 | 0s | if ($self->eval($data->[$idx], $schema->{$state->{keyword}}, # spent 24.1s making 1443 calls to JSON::Schema::Modern::Vocabulary::eval, avg 16.7ms/call, recursion: max depth 33, sum of overlapping time 24.1s |
313 | +{ %$state, data_path => $state->{data_path}.'/'.$idx, | ||||
314 | schema_path => $state->{schema_path}.'/'.$state->{keyword} })) { | ||||
315 | 1443 | 7.14ms | next; | ||
316 | } | ||||
317 | |||||
318 | $valid = 0; | ||||
319 | } | ||||
320 | last if $state->{short_circuit}; | ||||
321 | } | ||||
322 | |||||
323 | 643 | 956µs | $state->{_last_items_index} = $data->$#*; | ||
324 | |||||
325 | 643 | 1.17ms | 643 | 51.4ms | A($state, true); # spent 51.4ms making 643 calls to JSON::Schema::Modern::Utilities::A, avg 80µs/call |
326 | return E($state, 'subschema is not valid against all %sitems', | ||||
327 | 643 | 180µs | $state->{keyword} eq 'additionalItems' ? 'additional ' : '') if not $valid; | ||
328 | 643 | 2.44ms | return 1; | ||
329 | } | ||||
330 | |||||
331 | 3 | 19µs | 3 | 228µs | # spent 6.96ms (22µs+6.94) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains which was called 3 times, avg 2.32ms/call:
# 3 times (22µs+6.94ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 2.32ms/call # spent 6.94ms making 3 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 2.31ms/call, recursion: max depth 1, sum of overlapping time 6.71ms |
332 | |||||
333 | sub _eval_keyword_contains ($self, $data, $schema, $state) { | ||||
334 | return 1 if not is_type('array', $data); | ||||
335 | |||||
336 | $state->{_num_contains} = 0; | ||||
337 | my (@errors, @valid); | ||||
338 | foreach my $idx (0 .. $data->$#*) { | ||||
339 | if ($self->eval($data->[$idx], $schema->{contains}, | ||||
340 | +{ %$state, errors => \@errors, | ||||
341 | data_path => $state->{data_path}.'/'.$idx, | ||||
342 | schema_path => $state->{schema_path}.'/contains' })) { | ||||
343 | ++$state->{_num_contains}; | ||||
344 | push @valid, $idx; | ||||
345 | |||||
346 | last if $state->{short_circuit} | ||||
347 | and (not exists $schema->{maxContains} or $state->{_num_contains} > $schema->{maxContains}) | ||||
348 | and ($state->{_num_contains} >= ($schema->{minContains}//1)); | ||||
349 | } | ||||
350 | } | ||||
351 | |||||
352 | # note: no items contained is only valid when minContains is explicitly 0 | ||||
353 | if (not $state->{_num_contains} | ||||
354 | and (($schema->{minContains}//1) > 0 or $state->{spec_version} eq 'draft7')) { | ||||
355 | push $state->{errors}->@*, @errors; | ||||
356 | return E($state, 'subschema is not valid against any item'); | ||||
357 | } | ||||
358 | |||||
359 | return $state->{spec_version} =~ /^draft(?:7|2019-09)$/ ? 1 | ||||
360 | : A($state, @valid == @$data ? true : \@valid); | ||||
361 | } | ||||
362 | |||||
363 | 387 | 1.96ms | 387 | 257ms | # spent 291ms (1.99+289) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties which was called 387 times, avg 752µs/call:
# 387 times (1.99ms+289ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 752µs/call # spent 317ms making 387 calls to JSON::Schema::Modern::Vocabulary::traverse_object_schemas, avg 819µs/call, recursion: max depth 3, sum of overlapping time 59.3ms |
364 | |||||
365 | 162460 | 36.7ms | # spent 87.1s (815ms+86.3) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties which was called 32492 times, avg 2.68ms/call:
# 32492 times (815ms+86.3s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 2.68ms/call | ||
366 | 32492 | 78.2ms | 32492 | 132ms | return 1 if not is_type('object', $data); # spent 132ms making 32492 calls to JSON::Schema::Modern::Utilities::is_type, avg 4µs/call |
367 | |||||
368 | 28612 | 7.82ms | my $valid = 1; | ||
369 | 28612 | 5.97ms | my @properties; | ||
370 | 28612 | 217ms | 28612 | 54.3ms | foreach my $property (sort keys $schema->{properties}->%*) { # spent 54.3ms making 28612 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 2µs/call |
371 | 166967 | 48.7ms | next if not exists $data->{$property}; | ||
372 | 11057 | 8.61ms | push @properties, $property; | ||
373 | |||||
374 | 11057 | 19.1ms | 11057 | 110ms | if (is_type('boolean', $schema->{properties}{$property})) { # spent 110ms making 11057 calls to JSON::Schema::Modern::Utilities::is_type, avg 10µs/call |
375 | 145 | 558µs | 145 | 366µs | next if $schema->{properties}{$property}; # spent 366µs making 145 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 3µs/call |
376 | $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
377 | _schema_path_suffix => $property }, 'property not permitted'); | ||||
378 | } | ||||
379 | else { | ||||
380 | 10912 | 171ms | 32736 | 87.3s | if ($self->eval($data->{$property}, $schema->{properties}{$property}, # spent 410s making 10912 calls to JSON::Schema::Modern::Vocabulary::eval, avg 37.5ms/call, recursion: max depth 33, sum of overlapping time 323s
# spent 157ms making 21824 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call |
381 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
382 | schema_path => jsonp($state->{schema_path}, 'properties', $property) })) { | ||||
383 | 10113 | 54.1ms | next; | ||
384 | } | ||||
385 | |||||
386 | 799 | 403µs | $valid = 0; | ||
387 | } | ||||
388 | 799 | 751µs | last if $state->{short_circuit}; | ||
389 | } | ||||
390 | |||||
391 | 28612 | 51.8ms | 28612 | 2.17s | A($state, \@properties); # spent 2.17s making 28612 calls to JSON::Schema::Modern::Utilities::A, avg 76µs/call |
392 | 28612 | 10.2ms | 799 | 200ms | return E($state, 'not all properties are valid') if not $valid; # spent 200ms making 799 calls to JSON::Schema::Modern::Utilities::E, avg 251µs/call |
393 | 27813 | 87.5ms | return 1; | ||
394 | } | ||||
395 | |||||
396 | 24 | 5µs | # spent 1.28ms (130µs+1.15) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties which was called 6 times, avg 213µs/call:
# 6 times (130µs+1.15ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 213µs/call | ||
397 | 6 | 6µs | 6 | 19µs | return if not assert_keyword_type($state, $schema, 'object'); # spent 19µs making 6 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 3µs/call |
398 | |||||
399 | 6 | 2µs | my $valid = 1; | ||
400 | 6 | 19µs | 6 | 1µs | foreach my $property (sort keys $schema->{patternProperties}->%*) { # spent 1µs making 6 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 167ns/call |
401 | 6 | 32µs | 6 | 233µs | $valid = 0 if not assert_pattern({ %$state, _schema_path_suffix => $property }, $property); # spent 233µs making 6 calls to JSON::Schema::Modern::Utilities::assert_pattern, avg 39µs/call |
402 | 6 | 20µs | 6 | 895µs | $valid = 0 if not $self->traverse_property_schema($schema, $state, $property); # spent 895µs making 6 calls to JSON::Schema::Modern::Vocabulary::traverse_property_schema, avg 149µs/call |
403 | } | ||||
404 | 6 | 15µs | return $valid; | ||
405 | } | ||||
406 | |||||
407 | 16845 | 4.90ms | # spent 72.9s (149ms+72.8) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties which was called 3369 times, avg 21.6ms/call:
# 3369 times (149ms+72.8s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 21.6ms/call | ||
408 | 3369 | 8.51ms | 3369 | 15.4ms | return 1 if not is_type('object', $data); # spent 15.4ms making 3369 calls to JSON::Schema::Modern::Utilities::is_type, avg 5µs/call |
409 | |||||
410 | 3369 | 709µs | my $valid = 1; | ||
411 | 3369 | 686µs | my @properties; | ||
412 | 3369 | 14.3ms | 3369 | 1.77ms | foreach my $property_pattern (sort keys $schema->{patternProperties}->%*) { # spent 1.77ms making 3369 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 526ns/call |
413 | 3369 | 102ms | 20041 | 37.4ms | foreach my $property (sort grep m/$property_pattern/, keys %$data) { # spent 31.8ms making 8336 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp, avg 4µs/call
# spent 4.51ms making 8336 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:match, avg 541ns/call
# spent 1.13ms making 3369 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 337ns/call |
414 | 1799 | 1.02ms | push @properties, $property; | ||
415 | 1799 | 2.58ms | 1799 | 18.7ms | if (is_type('boolean', $schema->{patternProperties}{$property_pattern})) { # spent 18.7ms making 1799 calls to JSON::Schema::Modern::Utilities::is_type, avg 10µs/call |
416 | 1061 | 2.40ms | 1061 | 1.43ms | next if $schema->{patternProperties}{$property_pattern}; # spent 1.43ms making 1061 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 1µs/call |
417 | $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
418 | _schema_path_suffix => $property_pattern }, 'property not permitted'); | ||||
419 | } | ||||
420 | else { | ||||
421 | 738 | 11.3ms | 2214 | 10.7ms | if ($self->eval($data->{$property}, $schema->{patternProperties}{$property_pattern}, # spent 10.7ms making 1476 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call
# spent 104s making 738 calls to JSON::Schema::Modern::Vocabulary::eval, avg 141ms/call, recursion: max depth 4, sum of overlapping time 104s |
422 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
423 | schema_path => jsonp($state->{schema_path}, 'patternProperties', $property_pattern) })) { | ||||
424 | 738 | 6.21ms | next; | ||
425 | } | ||||
426 | |||||
427 | $valid = 0; | ||||
428 | } | ||||
429 | last if $state->{short_circuit}; | ||||
430 | } | ||||
431 | } | ||||
432 | |||||
433 | 3369 | 20.1ms | 6738 | 283ms | A($state, [ uniqstr @properties ]); # spent 275ms making 3369 calls to JSON::Schema::Modern::Utilities::A, avg 82µs/call
# spent 7.40ms making 3369 calls to List::Util::uniqstr, avg 2µs/call |
434 | 3369 | 902µs | return E($state, 'not all properties are valid') if not $valid; | ||
435 | 3369 | 12.2ms | return 1; | ||
436 | } | ||||
437 | |||||
438 | 130 | 664µs | 130 | 27.0ms | # spent 28.3ms (759µs+27.6) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties which was called 130 times, avg 218µs/call:
# 130 times (759µs+27.6ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 218µs/call # spent 34.1ms making 130 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 262µs/call, recursion: max depth 2, sum of overlapping time 7.15ms |
439 | |||||
440 | 4885 | 1.55ms | # spent 60.9s (69.3ms+60.8) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties which was called 977 times, avg 62.3ms/call:
# 977 times (69.3ms+60.8s) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 62.3ms/call | ||
441 | 977 | 2.03ms | 977 | 3.58ms | return 1 if not is_type('object', $data); # spent 3.58ms making 977 calls to JSON::Schema::Modern::Utilities::is_type, avg 4µs/call |
442 | |||||
443 | 977 | 296µs | my $valid = 1; | ||
444 | 977 | 258µs | my @properties; | ||
445 | 977 | 8.80ms | 977 | 715µs | foreach my $property (sort keys %$data) { # spent 715µs making 977 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 732ns/call |
446 | 1835 | 1.45ms | next if exists $schema->{properties} and exists $schema->{properties}{$property}; | ||
447 | next if exists $schema->{patternProperties} | ||||
448 | 1835 | 888µs | and any { $property =~ /$_/ } keys $schema->{patternProperties}->%*; | ||
449 | |||||
450 | 1835 | 1.67ms | push @properties, $property; | ||
451 | 1835 | 2.95ms | 1835 | 18.2ms | if (is_type('boolean', $schema->{additionalProperties})) { # spent 18.2ms making 1835 calls to JSON::Schema::Modern::Utilities::is_type, avg 10µs/call |
452 | next if $schema->{additionalProperties}; | ||||
453 | $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property) }, | ||||
454 | 'additional property not permitted'); | ||||
455 | } | ||||
456 | else { | ||||
457 | 1835 | 27.5ms | 3670 | 15.3ms | if ($self->eval($data->{$property}, $schema->{additionalProperties}, # spent 15.3ms making 1835 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call
# spent 98.2s making 1835 calls to JSON::Schema::Modern::Vocabulary::eval, avg 53.5ms/call, recursion: max depth 30, sum of overlapping time 98.2s |
458 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
459 | schema_path => $state->{schema_path}.'/additionalProperties' })) { | ||||
460 | 1835 | 10.2ms | next; | ||
461 | } | ||||
462 | |||||
463 | $valid = 0; | ||||
464 | } | ||||
465 | last if $state->{short_circuit}; | ||||
466 | } | ||||
467 | |||||
468 | 977 | 1.42ms | 977 | 63.7ms | A($state, \@properties); # spent 63.7ms making 977 calls to JSON::Schema::Modern::Utilities::A, avg 65µs/call |
469 | 977 | 254µs | return E($state, 'not all additional properties are valid') if not $valid; | ||
470 | 977 | 3.34ms | return 1; | ||
471 | } | ||||
472 | |||||
473 | 14 | 89µs | 14 | 3.58ms | # spent 3.71ms (69µs+3.64) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames which was called 14 times, avg 265µs/call:
# 14 times (69µs+3.64ms) by JSON::Schema::Modern::_traverse_subschema at line 487 of JSON/Schema/Modern.pm, avg 265µs/call # spent 3.64ms making 14 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 260µs/call, recursion: max depth 1, sum of overlapping time 63µs |
474 | |||||
475 | 3135 | 869µs | # spent 372ms (21.0+351) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames which was called 627 times, avg 593µs/call:
# 627 times (21.0ms+351ms) by JSON::Schema::Modern::_eval_subschema at line 578 of JSON/Schema/Modern.pm, avg 593µs/call | ||
476 | 627 | 1.06ms | 627 | 1.65ms | return 1 if not is_type('object', $data); # spent 1.65ms making 627 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call |
477 | |||||
478 | 627 | 227µs | my $valid = 1; | ||
479 | 627 | 3.17ms | 627 | 178µs | foreach my $property (sort keys %$data) { # spent 178µs making 627 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 284ns/call |
480 | 713 | 9.02ms | 1426 | 6.58ms | if ($self->eval($property, $schema->{propertyNames}, # spent 6.58ms making 713 calls to JSON::Schema::Modern::Utilities::jsonp, avg 9µs/call
# spent 343ms making 713 calls to JSON::Schema::Modern::Vocabulary::eval, avg 481µs/call, recursion: max depth 7, sum of overlapping time 343ms |
481 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
482 | schema_path => $state->{schema_path}.'/propertyNames' })) { | ||||
483 | 713 | 2.72ms | next; | ||
484 | } | ||||
485 | |||||
486 | $valid = 0; | ||||
487 | last if $state->{short_circuit}; | ||||
488 | } | ||||
489 | |||||
490 | 627 | 289µs | return E($state, 'not all property names are valid') if not $valid; | ||
491 | 627 | 1.86ms | return 1; | ||
492 | } | ||||
493 | |||||
494 | 1 | 19µs | 1; | ||
495 | |||||
496 | 1 | 55µs | 1 | 588µs | __END__ # spent 588µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:26] |
# spent 4.51ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:match which was called 8340 times, avg 541ns/call:
# 8336 times (4.51ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 413, avg 541ns/call
# 4 times (5µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 1µs/call | |||||
# spent 6µs within JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr which was called 4 times, avg 2µs/call:
# 4 times (6µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 2µs/call | |||||
# spent 31.8ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp which was called 8340 times, avg 4µs/call:
# 8336 times (31.8ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 413, avg 4µs/call
# 4 times (6µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 2µs/call | |||||
# spent 58.2ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort which was called 37265 times, avg 2µs/call:
# 28612 times (54.3ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties at line 370, avg 2µs/call
# 3369 times (1.77ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 412, avg 526ns/call
# 3369 times (1.13ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 413, avg 337ns/call
# 977 times (715µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties at line 445, avg 732ns/call
# 627 times (178µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames at line 479, avg 284ns/call
# 305 times (169µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas at line 164, avg 554ns/call
# 6 times (1µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties at line 400, avg 167ns/call | |||||
# 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 |