Filename | /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern/Vocabulary/Applicator.pm |
Statements | Executed 807141 statements in 1.32s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
32177 | 1 | 1 | 617ms | 64.4s | _eval_keyword_properties (recurses: max depth 11, inclusive time 237s) | JSON::Schema::Modern::Vocabulary::Applicator::
5941 | 1 | 1 | 375ms | 46.8s | _eval_keyword_allOf (recurses: max depth 13, inclusive time 126s) | JSON::Schema::Modern::Vocabulary::Applicator::
3368 | 1 | 1 | 114ms | 54.1s | _eval_keyword_patternProperties (recurses: max depth 2, inclusive time 23.7s) | JSON::Schema::Modern::Vocabulary::Applicator::
3002 | 1 | 1 | 74.8ms | 48.7s | _eval_keyword_if (recurses: max depth 1, inclusive time 2.77s) | JSON::Schema::Modern::Vocabulary::Applicator::
971 | 1 | 1 | 71.4ms | 43.9s | _eval_keyword_additionalProperties (recurses: max depth 4, inclusive time 27.4s) | JSON::Schema::Modern::Vocabulary::Applicator::
36961 | 7 | 1 | 43.7ms | 43.7ms | CORE:sort (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
1739 | 1 | 1 | 39.4ms | 15.4s | _eval_keyword__items_schema (recurses: max depth 4, inclusive time 1.48s) | JSON::Schema::Modern::Vocabulary::Applicator::
1172 | 1 | 1 | 38.8ms | 2.60s | _eval_keyword_anyOf | JSON::Schema::Modern::Vocabulary::Applicator::
8332 | 2 | 1 | 27.5ms | 27.5ms | CORE:regcomp (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
627 | 1 | 1 | 16.7ms | 265ms | _eval_keyword_propertyNames | JSON::Schema::Modern::Vocabulary::Applicator::
1739 | 1 | 1 | 12.6ms | 15.4s | _eval_keyword_items (recurses: max depth 4, inclusive time 1.48s) | JSON::Schema::Modern::Vocabulary::Applicator::
304 | 1 | 1 | 9.58ms | 250ms | _eval_keyword_oneOf | JSON::Schema::Modern::Vocabulary::Applicator::
304 | 1 | 1 | 6.54ms | 3.22s | _eval_keyword_dependentSchemas | JSON::Schema::Modern::Vocabulary::Applicator::
8332 | 2 | 1 | 3.74ms | 3.74ms | CORE:match (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 1.79ms | 1.96ms | BEGIN@19 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 1.68ms | 4.11ms | BEGIN@21 | JSON::Schema::Modern::Vocabulary::Applicator::
382 | 1 | 1 | 1.50ms | 282ms | _traverse_keyword_properties (recurses: max depth 3, inclusive time 53.0ms) | JSON::Schema::Modern::Vocabulary::Applicator::
96 | 1 | 1 | 792µs | 104ms | _traverse_keyword_items (recurses: max depth 1, inclusive time 3.94ms) | JSON::Schema::Modern::Vocabulary::Applicator::
130 | 1 | 1 | 629µs | 25.7ms | _traverse_keyword_additionalProperties (recurses: max depth 1, inclusive time 5.18ms) | JSON::Schema::Modern::Vocabulary::Applicator::
63 | 1 | 1 | 275µs | 16.1ms | _traverse_keyword_then | JSON::Schema::Modern::Vocabulary::Applicator::
63 | 1 | 1 | 269µs | 35.0ms | _traverse_keyword_if | JSON::Schema::Modern::Vocabulary::Applicator::
6 | 1 | 1 | 178µs | 1.50ms | _traverse_keyword_patternProperties | JSON::Schema::Modern::Vocabulary::Applicator::
31 | 1 | 1 | 141µs | 12.9ms | _traverse_keyword_anyOf (recurses: max depth 1, inclusive time 155µs) | JSON::Schema::Modern::Vocabulary::Applicator::
14 | 1 | 1 | 117µs | 1.47ms | _traverse_keyword_not | JSON::Schema::Modern::Vocabulary::Applicator::
22 | 1 | 1 | 103µs | 44.3ms | _traverse_keyword_allOf | JSON::Schema::Modern::Vocabulary::Applicator::
21 | 1 | 1 | 84µs | 11.6ms | _traverse_keyword_oneOf | JSON::Schema::Modern::Vocabulary::Applicator::
15 | 1 | 1 | 78µs | 3.19ms | _traverse_keyword_else | JSON::Schema::Modern::Vocabulary::Applicator::
14 | 1 | 1 | 73µs | 3.33ms | _traverse_keyword_propertyNames | JSON::Schema::Modern::Vocabulary::Applicator::
4 | 1 | 1 | 46µs | 1.93ms | _eval_keyword_not | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 40µs | 64µs | BEGIN@13 | JSON::Schema::Modern::Vocabulary::Applicator::
2 | 2 | 1 | 28µs | 44µs | keywords | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 27µs | 30µs | BEGIN@1.307 | Module::Runtime::
3 | 1 | 1 | 21µs | 6.08ms | _traverse_keyword_contains | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 13µs | 677µs | BEGIN@11 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 11µs | 48µs | BEGIN@17 | JSON::Schema::Modern::Vocabulary::Applicator::
3 | 1 | 1 | 11µs | 4.66ms | _traverse_keyword_dependentSchemas | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 9µs | 22µs | BEGIN@14 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 9µs | 240µs | BEGIN@22 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 9µs | 9µs | BEGIN@9 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 8µs | 16µs | BEGIN@16 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 8µs | 53µs | BEGIN@20 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 7µs | 145µs | BEGIN@12 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 7µs | 21µs | BEGIN@18 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 6µs | 175µs | BEGIN@10 | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 5µs | 18µs | BEGIN@15 | JSON::Schema::Modern::Vocabulary::Applicator::
4 | 1 | 1 | 5µs | 5µs | CORE:qr (opcode) | JSON::Schema::Modern::Vocabulary::Applicator::
1 | 1 | 1 | 5µs | 28µs | BEGIN@2.308 | Module::Runtime::
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 | 1µs | 1µs | __ANON__ (xsub) | JSON::Schema::Modern::Vocabulary::Applicator::
0 | 0 | 0 | 0s | 0s | __ANON__[:455] | 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 | 28µs | 2 | 33µs | # spent 30µs (27+3) within Module::Runtime::BEGIN@1.307 which was called:
# once (27µs+3µs) by Module::Runtime::require_module at line 1 # spent 30µs making 1 call to Module::Runtime::BEGIN@1.307
# spent 3µs making 1 call to strict::import |
2 | 2 | 35µs | 2 | 51µs | # spent 28µs (5+23) within Module::Runtime::BEGIN@2.308 which was called:
# once (5µs+23µs) by Module::Runtime::require_module at line 2 # spent 28µs making 1 call to Module::Runtime::BEGIN@2.308
# spent 23µ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.559'; | ||
8 | |||||
9 | 2 | 27µs | 1 | 9µs | # spent 9µs within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9 which was called:
# once (9µs+0s) by Module::Runtime::require_module at line 9 # spent 9µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9 |
10 | 2 | 25µs | 2 | 344µs | # spent 175µs (6+169) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10 which was called:
# once (6µs+169µs) by Module::Runtime::require_module at line 10 # spent 175µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10
# spent 169µs making 1 call to Moo::import |
11 | 3 | 27µs | 3 | 1.34ms | # spent 677µs (13+664) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11 which was called:
# once (13µs+664µs) by Module::Runtime::require_module at line 11 # spent 677µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11
# spent 647µs making 1 call to strictures::import
# spent 17µs making 1 call to strictures::VERSION |
12 | 2 | 59µs | 2 | 283µs | # spent 145µs (7+138) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12 which was called:
# once (7µs+138µs) by Module::Runtime::require_module at line 12 # spent 145µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12
# spent 138µs making 1 call to experimental::import |
13 | 2 | 22µs | 2 | 67µs | # spent 64µs (40+24) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13 which was called:
# once (40µs+24µs) by Module::Runtime::require_module at line 13 # spent 64µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13
# spent 3µs making 1 call to if::import |
14 | 2 | 20µs | 2 | 24µs | # spent 22µs (9+13) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14 which was called:
# once (9µs+13µs) by Module::Runtime::require_module at line 14 # spent 22µ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 | 19µs | # spent 18µs (5+13) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15 which was called:
# once (5µs+13µs) by Module::Runtime::require_module at line 15 # spent 18µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15
# spent 1µs making 1 call to if::unimport |
16 | 2 | 16µs | 2 | 16µs | # spent 16µs (8+8) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16 which was called:
# once (8µs+8µs) by Module::Runtime::require_module at line 16 # spent 16µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16
# spent 0s making 1 call to if::unimport |
17 | 3 | 29µs | 3 | 62µs | # spent 48µs (11+37) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17 which was called:
# once (11µs+37µs) by Module::Runtime::require_module at line 17 # spent 48µ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 | 22µs | 3 | 35µs | # spent 21µs (7+14) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18 which was called:
# once (7µs+14µs) by Module::Runtime::require_module at line 18 # spent 21µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18
# spent 11µs making 1 call to Exporter::import
# spent 3µs making 1 call to UNIVERSAL::VERSION |
19 | 2 | 654µs | 2 | 1.97ms | # spent 1.96ms (1.79+176µs) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19 which was called:
# once (1.79ms+176µs) by Module::Runtime::require_module at line 19 # spent 1.96ms making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19
# spent 3µs making 1 call to Sub::Install::__ANON__[Sub/Install.pm:270] |
20 | 2 | 21µs | 2 | 98µs | # spent 53µs (8+45) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20 which was called:
# once (8µs+45µs) by Module::Runtime::require_module at line 20 # spent 53µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20
# spent 45µs making 1 call to Exporter::import |
21 | 2 | 363µs | 2 | 4.11ms | # spent 4.11ms (1.68+2.43) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21 which was called:
# once (1.68ms+2.43ms) by Module::Runtime::require_module at line 21 # spent 4.11ms making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21
# spent 1µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ |
22 | 2 | 4.23ms | 2 | 471µs | # spent 240µs (9+231) within JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22 which was called:
# once (9µs+231µs) by Module::Runtime::require_module at line 22 # spent 240µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22
# spent 231µs making 1 call to namespace::clean::import |
23 | |||||
24 | 1 | 2µs | 1 | 585µs | with 'JSON::Schema::Modern::Vocabulary'; # spent 585µ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/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm:709] at line 705 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm | ||||
27 | 1 | 3µ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 | 6µ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 337 of /Users/ether/git/JSON-Schema-Modern/lib/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 | 2µs | # spent 44µs (28+16) within JSON::Schema::Modern::Vocabulary::Applicator::keywords which was called 2 times, avg 22µs/call:
# once (16µs+8µs) by JSON::Schema::Modern::_traverse_subschema at line 480 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm
# once (12µs+8µs) by JSON::Schema::Modern::_eval_subschema at line 572 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm | ||
43 | return ( | ||||
44 | 2 | 45µs | 12 | 16µs | qw(allOf anyOf oneOf not if then else), # spent 7µ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:qr, avg 1µs/call
# spent 4µ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 | 1µs | 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 | 20µs | 4 | 138µs | }), # spent 138µs making 4 calls to Sub::Install::__ANON__[Sub/Install.pm:118], avg 34µs/call |
65 | } | ||||
66 | } | ||||
67 | |||||
68 | 22 | 89µs | 22 | 43.4ms | # spent 44.3ms (103µs+44.2) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf which was called 22 times, avg 2.01ms/call:
# 22 times (103µs+44.2ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 2.01ms/call # spent 44.2ms making 22 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 2.01ms/call, recursion: max depth 1, sum of overlapping time 859µs |
69 | |||||
70 | 29705 | 5.62ms | # spent 46.8s (375ms+46.4) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf which was called 5941 times, avg 7.87ms/call:
# 5941 times (375ms+46.4s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 7.87ms/call | ||
71 | 5941 | 877µs | my @invalid; | ||
72 | 5941 | 10.3ms | foreach my $idx (0 .. $schema->{allOf}->$#*) { | ||
73 | 25474 | 325ms | 25474 | 0s | if ($self->eval($data, $schema->{allOf}[$idx], +{ %$state, # spent 172s making 25474 calls to JSON::Schema::Modern::Vocabulary::eval, avg 6.77ms/call, recursion: max depth 32, sum of overlapping time 172s |
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 | 5941 | 16.5ms | 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 | 31 | 130µs | 31 | 11.4ms | # spent 12.9ms (141µs+12.7) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf which was called 31 times, avg 415µs/call:
# 31 times (141µs+12.7ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 415µs/call # spent 12.9ms making 31 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 416µs/call, recursion: max depth 2, sum of overlapping time 1.44ms |
89 | |||||
90 | 5860 | 1.67ms | # spent 2.60s (38.8ms+2.57) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf which was called 1172 times, avg 2.22ms/call:
# 1172 times (38.8ms+2.57s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 2.22ms/call | ||
91 | 1172 | 383µs | my $valid = 0; | ||
92 | 1172 | 259µs | my @errors; | ||
93 | 1172 | 2.69ms | foreach my $idx (0 .. $schema->{anyOf}->$#*) { | ||
94 | next if not $self->eval($data, $schema->{anyOf}[$idx], | ||||
95 | 2345 | 25.6ms | 2345 | 4.83ms | +{ %$state, errors => \@errors, schema_path => $state->{schema_path}.'/anyOf/'.$idx }); # spent 2.57s making 2345 calls to JSON::Schema::Modern::Vocabulary::eval, avg 1.09ms/call, recursion: max depth 34, sum of overlapping time 2.56s |
96 | 1173 | 313µs | ++$valid; | ||
97 | 1173 | 1.02ms | last if $state->{short_circuit}; | ||
98 | } | ||||
99 | |||||
100 | 1172 | 5.61ms | return 1 if $valid; | ||
101 | push $state->{errors}->@*, @errors; | ||||
102 | return E($state, 'no subschemas are valid'); | ||||
103 | } | ||||
104 | |||||
105 | 21 | 80µs | 21 | 11.5ms | # spent 11.6ms (84µs+11.5) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf which was called 21 times, avg 553µs/call:
# 21 times (84µs+11.5ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 553µs/call # spent 11.5ms making 21 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 549µs/call |
106 | |||||
107 | 1520 | 350µs | # spent 250ms (9.58+241) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf which was called 304 times, avg 823µs/call:
# 304 times (9.58ms+241ms) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 823µs/call | ||
108 | 304 | 95µs | my (@valid, @errors); | ||
109 | 304 | 771µs | foreach my $idx (0 .. $schema->{oneOf}->$#*) { | ||
110 | next if not $self->eval($data, $schema->{oneOf}[$idx], | ||||
111 | 608 | 6.03ms | 608 | 0s | +{ %$state, errors => \@errors, schema_path => $state->{schema_path}.'/oneOf/'.$idx }); # spent 241ms making 608 calls to JSON::Schema::Modern::Vocabulary::eval, avg 396µs/call, recursion: max depth 9, sum of overlapping time 241ms |
112 | 304 | 245µs | push @valid, $idx; | ||
113 | 304 | 311µs | last if @valid > 1 and $state->{short_circuit}; | ||
114 | } | ||||
115 | |||||
116 | 304 | 1.52ms | 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 | 14 | 77µs | 14 | 1.06ms | # spent 1.47ms (117µs+1.35) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not which was called 14 times, avg 105µs/call:
# 14 times (117µs+1.35ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 105µs/call # spent 1.35ms making 14 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 97µs/call, recursion: max depth 1, sum of overlapping time 287µs |
128 | |||||
129 | 20 | 5µs | # spent 1.93ms (46µs+1.88) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not which was called 4 times, avg 481µs/call:
# 4 times (46µs+1.88ms) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 481µ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 | 39µs | 4 | 0s | errors => [] }); # spent 1.88ms making 4 calls to JSON::Schema::Modern::Vocabulary::eval, avg 470µs/call, recursion: max depth 12, sum of overlapping time 1.88ms |
134 | |||||
135 | return E($state, 'subschema is valid'); | ||||
136 | } | ||||
137 | |||||
138 | 63 | 217µs | 63 | 8.01ms | # spent 35.0ms (269µs+34.8) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if which was called 63 times, avg 556µs/call:
# 63 times (269µs+34.8ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 556µs/call # spent 34.8ms making 63 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 552µs/call, recursion: max depth 2, sum of overlapping time 26.8ms |
139 | 63 | 213µs | 63 | 12.5ms | # spent 16.1ms (275µs+15.8) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then which was called 63 times, avg 255µs/call:
# 63 times (275µs+15.8ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 255µs/call # spent 15.8ms making 63 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 251µs/call, recursion: max depth 2, sum of overlapping time 3.30ms |
140 | 15 | 52µs | 15 | 3.12ms | # spent 3.19ms (78µs+3.12) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else which was called 15 times, avg 213µs/call:
# 15 times (78µs+3.12ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 213µs/call # spent 3.12ms making 15 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 208µs/call |
141 | |||||
142 | 15010 | 3.00ms | # spent 48.7s (74.8ms+48.6) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if which was called 3002 times, avg 16.2ms/call:
# 3002 times (74.8ms+48.6s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 16.2ms/call | ||
143 | return 1 if not exists $schema->{then} and not exists $schema->{else} | ||||
144 | 3002 | 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 | 3002 | 43.0ms | 3002 | 0s | errors => [], # spent 2.03s making 3002 calls to JSON::Schema::Modern::Vocabulary::eval, avg 676µs/call, recursion: max depth 11, sum of overlapping time 2.03s |
149 | }) | ||||
150 | ? 'then' : 'else'; | ||||
151 | |||||
152 | 3002 | 3.54ms | return 1 if not exists $schema->{$keyword}; | ||
153 | return 1 if $self->eval($data, $schema->{$keyword}, | ||||
154 | 2207 | 24.0ms | 2207 | 0s | +{ %$state, schema_path => $state->{schema_path}.'/'.$keyword }); # spent 49.3s making 2207 calls to JSON::Schema::Modern::Vocabulary::eval, avg 22.4ms/call, recursion: max depth 11, sum of overlapping time 49.3s |
155 | return E({ %$state, keyword => $keyword }, 'subschema is not valid'); | ||||
156 | } | ||||
157 | |||||
158 | 3 | 10µs | 3 | 0s | # spent 4.66ms (11µs+4.65) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas which was called 3 times, avg 1.55ms/call:
# 3 times (11µs+4.65ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 1.55ms/call # spent 4.65ms making 3 calls to JSON::Schema::Modern::Vocabulary::traverse_object_schemas, avg 1.55ms/call, recursion: max depth 1, sum of overlapping time 4.65ms |
159 | |||||
160 | 1520 | 287µs | # spent 3.22s (6.54ms+3.22) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas which was called 304 times, avg 10.6ms/call:
# 304 times (6.54ms+3.22s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 10.6ms/call | ||
161 | 304 | 348µs | 304 | 429µs | return 1 if not is_type('object', $data); # spent 429µs making 304 calls to JSON::Schema::Modern::Utilities::is_type, avg 1µs/call |
162 | |||||
163 | 304 | 92µs | my $valid = 1; | ||
164 | 304 | 1.19ms | 304 | 159µs | foreach my $property (sort keys $schema->{dependentSchemas}->%*) { # spent 159µs making 304 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 523ns/call |
165 | 304 | 99µs | next if not exists $data->{$property}; | ||
166 | |||||
167 | 289 | 2.18ms | 578 | 1.97ms | if ($self->eval($data, $schema->{dependentSchemas}{$property}, # spent 1.97ms making 289 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call
# spent 3.21s making 289 calls to JSON::Schema::Modern::Vocabulary::eval, avg 11.1ms/call, recursion: max depth 9, sum of overlapping time 3.21s |
168 | +{ %$state, schema_path => jsonp($state->{schema_path}, 'dependentSchemas', $property) })) { | ||||
169 | 289 | 932µs | next; | ||
170 | } | ||||
171 | |||||
172 | $valid = 0; | ||||
173 | last if $state->{short_circuit}; | ||||
174 | } | ||||
175 | |||||
176 | 304 | 77µs | return E($state, 'not all dependencies are satisfied') if not $valid; | ||
177 | 304 | 871µs | 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 | 384 | 67µs | # spent 104ms (792µs+103) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items which was called 96 times, avg 1.09ms/call:
# 96 times (792µs+103ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 1.09ms/call | ||
239 | 96 | 64µ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 | 96 | 541µs | 96 | 101ms | $self->traverse_subschema($schema, $state); # spent 107ms making 96 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 1.12ms/call, recursion: max depth 1, sum of overlapping time 6.11ms |
247 | } | ||||
248 | |||||
249 | 8695 | 2.62ms | # spent 15.4s (12.6ms+15.4) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items which was called 1739 times, avg 8.88ms/call:
# 1739 times (12.6ms+15.4s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 8.88ms/call | ||
250 | return $self->_eval_keyword__items_array_schemas($data, $schema, $state) | ||||
251 | 1739 | 1.02ms | if is_plain_arrayref($schema->{items}); | ||
252 | |||||
253 | 1739 | 7.27ms | 1739 | 15.4s | return $self->_eval_keyword__items_schema($data, $schema, $state); # spent 16.9s making 1739 calls to JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema, avg 9.73ms/call, recursion: max depth 4, sum of overlapping time 1.48s |
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, collect_annotations => $state->{collect_annotations} & ~1 }, | ||||
278 | 'item not permitted'); | ||||
279 | } | ||||
280 | elsif ($self->eval($data->[$idx], $schema->{$state->{keyword}}[$idx], | ||||
281 | +{ %$state, data_path => $state->{data_path}.'/'.$idx, | ||||
282 | schema_path => $state->{schema_path}.'/'.$state->{keyword}.'/'.$idx, | ||||
283 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
284 | next; | ||||
285 | } | ||||
286 | |||||
287 | $valid = 0; | ||||
288 | last if $state->{short_circuit} and not exists $schema->{ | ||||
289 | $state->{keyword} eq 'prefixItems' ? 'items' | ||||
290 | : $state->{keyword} eq 'items' ? 'additionalItems' : die | ||||
291 | }; | ||||
292 | } | ||||
293 | |||||
294 | A($state, $state->{_last_items_index} == $data->$#* ? true : $state->{_last_items_index}); | ||||
295 | return E($state, 'not all items are valid') if not $valid; | ||||
296 | return 1; | ||||
297 | } | ||||
298 | |||||
299 | # schema-based items (all drafts), and additionalItems (up to and including draft2019-09) | ||||
300 | 8695 | 2.30ms | # spent 15.4s (39.4ms+15.4) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema which was called 1739 times, avg 8.87ms/call:
# 1739 times (39.4ms+15.4s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items at line 253, avg 8.87ms/call | ||
301 | 1739 | 5.37ms | 1739 | 5.39ms | return 1 if not is_type('array', $data); # spent 5.39ms making 1739 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call |
302 | 634 | 752µs | return 1 if ($state->{_last_items_index}//-1) == $data->$#*; | ||
303 | |||||
304 | 634 | 257µs | my $valid = 1; | ||
305 | |||||
306 | 634 | 2.08ms | foreach my $idx (($state->{_last_items_index}//-1)+1 .. $data->$#*) { | ||
307 | 1597 | 2.47ms | 1597 | 9.98ms | if (is_type('boolean', $schema->{$state->{keyword}})) { # spent 9.98ms making 1597 calls to JSON::Schema::Modern::Utilities::is_type, avg 6µs/call |
308 | 187 | 256µs | 187 | 153µs | next if $schema->{$state->{keyword}}; # spent 153µs making 187 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:8], avg 818ns/call |
309 | $valid = E({ %$state, data_path => $state->{data_path}.'/'.$idx }, | ||||
310 | '%sitem not permitted', | ||||
311 | exists $schema->{prefixItems} || $state->{keyword} eq 'additionalItems' ? 'additional ' : ''); | ||||
312 | } | ||||
313 | else { | ||||
314 | 1410 | 14.2ms | 1410 | 0s | if ($self->eval($data->[$idx], $schema->{$state->{keyword}}, # spent 16.9s making 1410 calls to JSON::Schema::Modern::Vocabulary::eval, avg 12.0ms/call, recursion: max depth 33, sum of overlapping time 16.9s |
315 | +{ %$state, data_path => $state->{data_path}.'/'.$idx, | ||||
316 | schema_path => $state->{schema_path}.'/'.$state->{keyword}, | ||||
317 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
318 | 1410 | 5.18ms | next; | ||
319 | } | ||||
320 | |||||
321 | $valid = 0; | ||||
322 | } | ||||
323 | last if $state->{short_circuit}; | ||||
324 | } | ||||
325 | |||||
326 | 634 | 757µs | $state->{_last_items_index} = $data->$#*; | ||
327 | |||||
328 | 634 | 876µs | 634 | 1.31ms | A($state, true); # spent 1.31ms making 634 calls to JSON::Schema::Modern::Utilities::A, avg 2µs/call |
329 | return E($state, 'subschema is not valid against all %sitems', | ||||
330 | 634 | 162µs | $state->{keyword} eq 'additionalItems' ? 'additional ' : '') if not $valid; | ||
331 | 634 | 1.78ms | return 1; | ||
332 | } | ||||
333 | |||||
334 | 3 | 19µs | 3 | 163µs | # spent 6.08ms (21µs+6.06) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains which was called 3 times, avg 2.03ms/call:
# 3 times (21µs+6.06ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 2.03ms/call # spent 6.06ms making 3 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 2.02ms/call, recursion: max depth 1, sum of overlapping time 5.90ms |
335 | |||||
336 | sub _eval_keyword_contains ($self, $data, $schema, $state) { | ||||
337 | return 1 if not is_type('array', $data); | ||||
338 | |||||
339 | $state->{_num_contains} = 0; | ||||
340 | my (@errors, @valid); | ||||
341 | |||||
342 | foreach my $idx (0 .. $data->$#*) { | ||||
343 | if ($self->eval($data->[$idx], $schema->{contains}, | ||||
344 | +{ %$state, errors => \@errors, | ||||
345 | data_path => $state->{data_path}.'/'.$idx, | ||||
346 | schema_path => $state->{schema_path}.'/contains', | ||||
347 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
348 | ++$state->{_num_contains}; | ||||
349 | push @valid, $idx; | ||||
350 | |||||
351 | last if $state->{short_circuit} | ||||
352 | and (not exists $schema->{maxContains} or $state->{_num_contains} > $schema->{maxContains}) | ||||
353 | and ($state->{_num_contains} >= ($schema->{minContains}//1)); | ||||
354 | } | ||||
355 | } | ||||
356 | |||||
357 | # note: no items contained is only valid when minContains is explicitly 0 | ||||
358 | if (not $state->{_num_contains} | ||||
359 | and (($schema->{minContains}//1) > 0 or $state->{spec_version} eq 'draft7')) { | ||||
360 | push $state->{errors}->@*, @errors; | ||||
361 | return E($state, 'subschema is not valid against any item'); | ||||
362 | } | ||||
363 | |||||
364 | return $state->{spec_version} =~ /^draft(?:7|2019-09)$/ ? 1 | ||||
365 | : A($state, @valid == @$data ? true : \@valid); | ||||
366 | } | ||||
367 | |||||
368 | 382 | 1.36ms | 382 | 247ms | # spent 282ms (1.50+280) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties which was called 382 times, avg 737µs/call:
# 382 times (1.50ms+280ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 737µs/call # spent 333ms making 382 calls to JSON::Schema::Modern::Vocabulary::traverse_object_schemas, avg 872µs/call, recursion: max depth 3, sum of overlapping time 86.2ms |
369 | |||||
370 | 160885 | 26.6ms | # spent 64.4s (617ms+63.8) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties which was called 32177 times, avg 2.00ms/call:
# 32177 times (617ms+63.8s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 2.00ms/call | ||
371 | 32177 | 51.4ms | 32177 | 81.7ms | return 1 if not is_type('object', $data); # spent 81.7ms making 32177 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call |
372 | |||||
373 | 28317 | 6.94ms | my $valid = 1; | ||
374 | 28317 | 4.43ms | my @properties; | ||
375 | 28317 | 163ms | 28317 | 40.7ms | foreach my $property (sort keys $schema->{properties}->%*) { # spent 40.7ms making 28317 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 1µs/call |
376 | 165088 | 35.3ms | next if not exists $data->{$property}; | ||
377 | 10976 | 4.96ms | push @properties, $property; | ||
378 | |||||
379 | 10976 | 14.9ms | 10976 | 79.1ms | if (is_type('boolean', $schema->{properties}{$property})) { # spent 79.1ms making 10976 calls to JSON::Schema::Modern::Utilities::is_type, avg 7µs/call |
380 | 142 | 503µs | 142 | 365µs | next if $schema->{properties}{$property}; # spent 365µs making 142 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:8], avg 3µs/call |
381 | $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
382 | _schema_path_suffix => $property }, 'property not permitted'); | ||||
383 | } | ||||
384 | else { | ||||
385 | 10834 | 126ms | 32502 | 64.5s | if ($self->eval($data->{$property}, $schema->{properties}{$property}, # spent 299s making 10834 calls to JSON::Schema::Modern::Vocabulary::eval, avg 27.6ms/call, recursion: max depth 33, sum of overlapping time 235s
# spent 126ms making 21668 calls to JSON::Schema::Modern::Utilities::jsonp, avg 6µs/call |
386 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
387 | schema_path => jsonp($state->{schema_path}, 'properties', $property), | ||||
388 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
389 | 10039 | 39.5ms | next; | ||
390 | } | ||||
391 | |||||
392 | 795 | 322µs | $valid = 0; | ||
393 | } | ||||
394 | 795 | 442µs | last if $state->{short_circuit}; | ||
395 | } | ||||
396 | |||||
397 | 28317 | 36.5ms | 28317 | 481ms | A($state, \@properties); # spent 481ms making 28317 calls to JSON::Schema::Modern::Utilities::A, avg 17µs/call |
398 | 28317 | 7.92ms | 795 | 156ms | return E($state, 'not all properties are valid') if not $valid; # spent 156ms making 795 calls to JSON::Schema::Modern::Utilities::E, avg 196µs/call |
399 | 27522 | 54.3ms | return 1; | ||
400 | } | ||||
401 | |||||
402 | 24 | 5µs | # spent 1.50ms (178µs+1.32) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties which was called 6 times, avg 249µs/call:
# 6 times (178µs+1.32ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 249µs/call | ||
403 | 6 | 9µs | 6 | 32µs | return if not assert_keyword_type($state, $schema, 'object'); # spent 32µs making 6 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 5µs/call |
404 | |||||
405 | 6 | 2µs | my $valid = 1; | ||
406 | 6 | 37µ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 |
407 | 6 | 40µs | 6 | 287µs | $valid = 0 if not assert_pattern({ %$state, _schema_path_suffix => $property }, $property); # spent 287µs making 6 calls to JSON::Schema::Modern::Utilities::assert_pattern, avg 48µs/call |
408 | 6 | 22µs | 6 | 998µs | $valid = 0 if not $self->traverse_property_schema($schema, $state, $property); # spent 998µs making 6 calls to JSON::Schema::Modern::Vocabulary::traverse_property_schema, avg 166µs/call |
409 | } | ||||
410 | 6 | 12µs | return $valid; | ||
411 | } | ||||
412 | |||||
413 | 16840 | 4.53ms | # spent 54.1s (114ms+54.0) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties which was called 3368 times, avg 16.1ms/call:
# 3368 times (114ms+54.0s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 16.1ms/call | ||
414 | 3368 | 5.14ms | 3368 | 9.53ms | return 1 if not is_type('object', $data); # spent 9.53ms making 3368 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call |
415 | |||||
416 | 3368 | 1.09ms | my $valid = 1; | ||
417 | 3368 | 810µs | my @properties; | ||
418 | 3368 | 11.4ms | 3368 | 1.28ms | foreach my $property_pattern (sort keys $schema->{patternProperties}->%*) { # spent 1.28ms making 3368 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 379ns/call |
419 | 3368 | 76.7ms | 20024 | 32.2ms | foreach my $property (sort grep m/$property_pattern/, keys %$data) { # spent 27.5ms making 8328 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp, avg 3µs/call
# spent 3.74ms making 8328 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:match, avg 449ns/call
# spent 931µs making 3368 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 276ns/call |
420 | 1799 | 831µs | push @properties, $property; | ||
421 | 1799 | 2.23ms | 1799 | 14.7ms | if (is_type('boolean', $schema->{patternProperties}{$property_pattern})) { # spent 14.7ms making 1799 calls to JSON::Schema::Modern::Utilities::is_type, avg 8µs/call |
422 | 1061 | 2.07ms | 1061 | 1.43ms | next if $schema->{patternProperties}{$property_pattern}; # spent 1.43ms making 1061 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:8], avg 1µs/call |
423 | $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
424 | _schema_path_suffix => $property_pattern }, 'property not permitted'); | ||||
425 | } | ||||
426 | else { | ||||
427 | 738 | 9.52ms | 2214 | 9.44ms | if ($self->eval($data->{$property}, $schema->{patternProperties}{$property_pattern}, # spent 9.44ms making 1476 calls to JSON::Schema::Modern::Utilities::jsonp, avg 6µs/call
# spent 77.4s making 738 calls to JSON::Schema::Modern::Vocabulary::eval, avg 105ms/call, recursion: max depth 4, sum of overlapping time 77.4s |
428 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
429 | schema_path => jsonp($state->{schema_path}, 'patternProperties', $property_pattern), | ||||
430 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
431 | 738 | 4.43ms | next; | ||
432 | } | ||||
433 | |||||
434 | $valid = 0; | ||||
435 | } | ||||
436 | last if $state->{short_circuit}; | ||||
437 | } | ||||
438 | } | ||||
439 | |||||
440 | 3368 | 16.6ms | 6736 | 217ms | A($state, [ uniqstr @properties ]); # spent 211ms making 3368 calls to JSON::Schema::Modern::Utilities::A, avg 63µs/call
# spent 5.14ms making 3368 calls to List::Util::uniqstr, avg 2µs/call |
441 | 3368 | 1.03ms | return E($state, 'not all properties are valid') if not $valid; | ||
442 | 3368 | 8.11ms | return 1; | ||
443 | } | ||||
444 | |||||
445 | 130 | 637µs | 130 | 24.6ms | # spent 25.7ms (629µs+25.1) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties which was called 130 times, avg 198µs/call:
# 130 times (629µs+25.1ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 198µs/call # spent 30.3ms making 130 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 233µs/call, recursion: max depth 2, sum of overlapping time 5.66ms |
446 | |||||
447 | 4855 | 1.16ms | # spent 43.9s (71.4ms+43.8) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties which was called 971 times, avg 45.2ms/call:
# 971 times (71.4ms+43.8s) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 45.2ms/call | ||
448 | 971 | 1.43ms | 971 | 2.28ms | return 1 if not is_type('object', $data); # spent 2.28ms making 971 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call |
449 | |||||
450 | 971 | 363µs | my $valid = 1; | ||
451 | 971 | 308µs | my @properties; | ||
452 | 971 | 6.16ms | 971 | 559µs | foreach my $property (sort keys %$data) { # spent 559µs making 971 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 576ns/call |
453 | 1816 | 1.32ms | next if exists $schema->{properties} and exists $schema->{properties}{$property}; | ||
454 | next if exists $schema->{patternProperties} | ||||
455 | 1816 | 838µs | and any { $property =~ /$_/ } keys $schema->{patternProperties}->%*; | ||
456 | |||||
457 | 1816 | 1.12ms | push @properties, $property; | ||
458 | 1816 | 2.00ms | 1816 | 12.9ms | if (is_type('boolean', $schema->{additionalProperties})) { # spent 12.9ms making 1816 calls to JSON::Schema::Modern::Utilities::is_type, avg 7µs/call |
459 | next if $schema->{additionalProperties}; | ||||
460 | $valid = E({ %$state, data_path => jsonp($state->{data_path}, $property) }, | ||||
461 | 'additional property not permitted'); | ||||
462 | } | ||||
463 | else { | ||||
464 | 1816 | 20.6ms | 3632 | 13.5ms | if ($self->eval($data->{$property}, $schema->{additionalProperties}, # spent 13.5ms making 1816 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call
# spent 71.2s making 1816 calls to JSON::Schema::Modern::Vocabulary::eval, avg 39.2ms/call, recursion: max depth 30, sum of overlapping time 71.2s |
465 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
466 | schema_path => $state->{schema_path}.'/additionalProperties', | ||||
467 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
468 | 1816 | 7.52ms | next; | ||
469 | } | ||||
470 | |||||
471 | $valid = 0; | ||||
472 | } | ||||
473 | last if $state->{short_circuit}; | ||||
474 | } | ||||
475 | |||||
476 | 971 | 1.15ms | 971 | 1.43ms | A($state, \@properties); # spent 1.43ms making 971 calls to JSON::Schema::Modern::Utilities::A, avg 1µs/call |
477 | 971 | 243µs | return E($state, 'not all additional properties are valid') if not $valid; | ||
478 | 971 | 3.22ms | return 1; | ||
479 | } | ||||
480 | |||||
481 | 14 | 80µs | 14 | 3.20ms | # spent 3.33ms (73µs+3.26) within JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames which was called 14 times, avg 238µs/call:
# 14 times (73µs+3.26ms) by JSON::Schema::Modern::_traverse_subschema at line 492 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 238µs/call # spent 3.26ms making 14 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 233µs/call, recursion: max depth 1, sum of overlapping time 60µs |
482 | |||||
483 | 3135 | 765µs | # spent 265ms (16.7+249) within JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames which was called 627 times, avg 423µs/call:
# 627 times (16.7ms+249ms) by JSON::Schema::Modern::_eval_subschema at line 587 of /Users/ether/git/JSON-Schema-Modern/lib/JSON/Schema/Modern.pm, avg 423µs/call | ||
484 | 627 | 750µs | 627 | 1.02ms | return 1 if not is_type('object', $data); # spent 1.02ms making 627 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call |
485 | |||||
486 | 627 | 231µs | my $valid = 1; | ||
487 | 627 | 2.42ms | 627 | 146µs | foreach my $property (sort keys %$data) { # spent 146µs making 627 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 233ns/call |
488 | 712 | 7.22ms | 1424 | 6.68ms | if ($self->eval($property, $schema->{propertyNames}, # spent 6.68ms making 712 calls to JSON::Schema::Modern::Utilities::jsonp, avg 9µs/call
# spent 241ms making 712 calls to JSON::Schema::Modern::Vocabulary::eval, avg 338µs/call, recursion: max depth 7, sum of overlapping time 241ms |
489 | +{ %$state, data_path => jsonp($state->{data_path}, $property), | ||||
490 | schema_path => $state->{schema_path}.'/propertyNames', | ||||
491 | collect_annotations => $state->{collect_annotations} & ~1 })) { | ||||
492 | 712 | 1.88ms | next; | ||
493 | } | ||||
494 | |||||
495 | $valid = 0; | ||||
496 | last if $state->{short_circuit}; | ||||
497 | } | ||||
498 | |||||
499 | 627 | 166µs | return E($state, 'not all property names are valid') if not $valid; | ||
500 | 627 | 1.54ms | return 1; | ||
501 | } | ||||
502 | |||||
503 | 1 | 17µs | 1; | ||
504 | 1 | 44µs | 1 | 373µs | __END__ # spent 373µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:26] |
# spent 3.74ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:match which was called 8332 times, avg 449ns/call:
# 8328 times (3.74ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 419, avg 449ns/call
# 4 times (4µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 1µs/call | |||||
# spent 5µs within JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr which was called 4 times, avg 1µs/call:
# 4 times (5µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 1µs/call | |||||
# spent 27.5ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp which was called 8332 times, avg 3µs/call:
# 8328 times (27.5ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 419, avg 3µs/call
# 4 times (7µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::keywords at line 44, avg 2µs/call | |||||
# spent 43.7ms within JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort which was called 36961 times, avg 1µs/call:
# 28317 times (40.7ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties at line 375, avg 1µs/call
# 3368 times (1.28ms+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 418, avg 379ns/call
# 3368 times (931µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 419, avg 276ns/call
# 971 times (559µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties at line 452, avg 576ns/call
# 627 times (146µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames at line 487, avg 233ns/call
# 304 times (159µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas at line 164, avg 523ns/call
# 6 times (1µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties at line 406, avg 167ns/call | |||||
# spent 1µs within JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ which was called:
# once (1µs+0s) by JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21 at line 21 |