← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 16:10:05 2022
Reported on Wed Dec 14 16:12:58 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Vocabulary/Applicator.pm
StatementsExecuted 814653 statements in 1.76s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3249211815ms87.1sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_propertiesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties (recurses: max depth 11, inclusive time 326s)
600211478ms64.9sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_allOfJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf (recurses: max depth 13, inclusive time 175s)
336911149ms72.9sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_patternPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties (recurses: max depth 2, inclusive time 31.9s)
301311102ms66.2sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_ifJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if (recurses: max depth 1, inclusive time 3.74s)
9771169.3ms60.9sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_additionalPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties (recurses: max depth 4, inclusive time 37.4s)
372657158.2ms58.2msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:sortJSON::Schema::Modern::Vocabulary::Applicator::CORE:sort (opcode)
17581151.5ms21.9sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword__items_schemaJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema (recurses: max depth 4, inclusive time 2.33s)
11821150.4ms3.34sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_anyOfJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf
83402131.8ms31.8msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:regcompJSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp (opcode)
6271121.0ms372msJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_propertyNamesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames
17581114.4ms21.9sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_itemsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_items (recurses: max depth 4, inclusive time 2.33s)
3051112.5ms316msJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_oneOfJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf
305118.18ms4.04sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_dependentSchemasJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas
8340214.51ms4.51msJSON::Schema::Modern::Vocabulary::Applicator::::CORE:matchJSON::Schema::Modern::Vocabulary::Applicator::CORE:match (opcode)
1112.15ms2.39msJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@19JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@19
1112.06ms4.54msJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@21JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21
387111.99ms291msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_propertiesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties (recurses: max depth 3, inclusive time 27.7ms)
9811916µs90.7msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_itemsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items (recurses: max depth 1, inclusive time 4.14ms)
13011759µs28.3msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_additionalPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties (recurses: max depth 1, inclusive time 6.53ms)
6511243µs11.9msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_ifJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if
6511243µs19.4msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_thenJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then
3211133µs15.1msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_anyOfJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf (recurses: max depth 1, inclusive time 137µs)
411130µs3.22msJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_notJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not
611130µs1.28msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_patternPropertiesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties
2311111µs22.3msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_allOfJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf
211193µs12.6msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_oneOfJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf
151189µs1.78msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_notJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not
141169µs3.71msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_propertyNamesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames
151159µs3.05msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_elseJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else
11153µs55µsModule::Runtime::::BEGIN@1.307 Module::Runtime::BEGIN@1.307
22141µs58µsJSON::Schema::Modern::Vocabulary::Applicator::::keywordsJSON::Schema::Modern::Vocabulary::Applicator::keywords
11126µs690µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@11JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@11
31122µs6.96msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_containsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains
11115µs54µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@17JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@17
11115µs27µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@18JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@18
31114µs7.44msJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_dependentSchemasJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas
11111µs32µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@13JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13
11110µs10µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@9JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@9
1119µs20µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@14JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14
1119µs20µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@15JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15
1118µs292µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@22JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@22
1117µs183µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@10JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10
1117µs84µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@12JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12
1117µs84µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@20JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20
4116µs6µsJSON::Schema::Modern::Vocabulary::Applicator::::CORE:qrJSON::Schema::Modern::Vocabulary::Applicator::CORE:qr (opcode)
1116µs38µsModule::Runtime::::BEGIN@2.308 Module::Runtime::BEGIN@2.308
1115µs12µsJSON::Schema::Modern::Vocabulary::Applicator::::BEGIN@16JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16
1113µs3µsJSON::Schema::Modern::Vocabulary::Applicator::::vocabularyJSON::Schema::Modern::Vocabulary::Applicator::vocabulary
4112µs2µsJSON::Schema::Modern::Vocabulary::Applicator::::evaluation_orderJSON::Schema::Modern::Vocabulary::Applicator::evaluation_order
1110s0sJSON::Schema::Modern::Vocabulary::Applicator::::__ANON__JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ (xsub)
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::__ANON__[:448]JSON::Schema::Modern::Vocabulary::Applicator::__ANON__[:448]
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::__ANON__[:63]JSON::Schema::Modern::Vocabulary::Applicator::__ANON__[:63]
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword__items_array_schemasJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_array_schemas
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_additionalItemsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalItems
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_containsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_contains
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_dependenciesJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependencies
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_eval_keyword_prefixItemsJSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_prefixItems
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_additionalItemsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalItems
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_dependenciesJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependencies
0000s0sJSON::Schema::Modern::Vocabulary::Applicator::::_traverse_keyword_prefixItemsJSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_prefixItems
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1250µs257µ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
use strict;
# spent 55µs making 1 call to Module::Runtime::BEGIN@1.307 # spent 2µs making 1 call to strict::import
2237µs270µ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
use warnings;
# spent 38µs making 1 call to Module::Runtime::BEGIN@2.308 # spent 32µs making 1 call to warnings::import
3package JSON::Schema::Modern::Vocabulary::Applicator;
4# vim: set ts=8 sts=2 sw=2 tw=100 et :
5# ABSTRACT: Implementation of the JSON Schema Applicator vocabulary
6
710sour $VERSION = '0.558';
8
9227µs110µ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
use 5.020;
10225µs2359µ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
use Moo;
# spent 183µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@10 # spent 176µs making 1 call to Moo::import
11346µs31.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
use strictures 2;
# 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
12233µs2161µ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
use experimental qw(signatures postderef);
# spent 84µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@12 # spent 77µs making 1 call to experimental::import
13224µs235µ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
use if "$]" >= 5.022, experimental => 're_strict';
# spent 32µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@13 # spent 3µs making 1 call to if::import
14218µs222µ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
no if "$]" >= 5.031009, feature => 'indirect';
# spent 20µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@14 # spent 2µs making 1 call to if::unimport
15217µs221µ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
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 20µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@15 # spent 1µs making 1 call to if::unimport
16217µs213µ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
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 12µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@16 # spent 1µs making 1 call to if::unimport
17330µs368µ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
use List::Util 1.45 qw(any uniqstr);
# 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
18329µs339µ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
use Ref::Util 0.100 'is_plain_arrayref';
# 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
192804µs22.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
use Sub::Install;
20227µs2161µ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
use JSON::Schema::Modern::Utilities qw(is_type jsonp E A assert_keyword_type assert_pattern true is_elements_unique);
# spent 84µs making 1 call to JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@20 # spent 77µs making 1 call to Exporter::import
212396µs24.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
use JSON::Schema::Modern::Vocabulary::Unevaluated;
2224.89ms2576µ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
use namespace::clean;
# 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
2419µs1688µswith '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
sub vocabulary {
2714µs 'https://json-schema.org/draft/2019-09/vocab/applicator' => 'draft2019-09',
28 'https://json-schema.org/draft/2020-12/vocab/applicator' => 'draft2020-12';
29}
30
31422µ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
sub evaluation_order { 1 }
32
33# the keyword order is arbitrary, except:
34# - if must be evaluated before then, else
35# - items must be evaluated before additionalItems
36# - in-place applicators (allOf, anyOf, oneOf, not, if/then/else, dependentSchemas) and items,
37# additionalItems must be evaluated before unevaluatedItems (in the Unevaluated vocabulary)
38# - properties and patternProperties must be evaluated before additionalProperties
39# - in-place applicators and properties, patternProperties, additionalProperties must be evaluated
40# before unevaluatedProperties (in the Unevaluated vocabulary)
41# - contains must be evaluated before maxContains, minContains (in the Validator vocabulary)
4261µ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
sub keywords ($self, $spec_version) {
43 return (
44259µs1217µ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
5510sforeach my $phase (qw(traverse eval)) {
5622µs foreach my $type (qw(Items Properties)) {
5742µs my $method = '_'.$phase.'_keyword_unevaluated'.$type;
58 Sub::Install::install_sub({
59 as => $method,
60 code => sub {
61 shift;
62 JSON::Schema::Modern::Vocabulary::Unevaluated->$method(@_);
63 }
64416µs4148µs }),
# spent 148µs making 4 calls to Sub::Install::__ANON__[Sub/Install.pm:118], avg 37µs/call
65 }
66}
67
682386µs2321.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
sub _traverse_keyword_allOf { shift->traverse_array_schemas(@_) }
# 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
70300107.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
sub _eval_keyword_allOf ($self, $data, $schema, $state) {
7160021.47ms my @invalid;
72600213.2ms foreach my $idx (0 .. $schema->{allOf}->$#*) {
7325750408ms257500s 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
82600221.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
8832143µs3214.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
sub _traverse_keyword_anyOf { shift->traverse_array_schemas(@_) }
# 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
9059102.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
sub _eval_keyword_anyOf ($self, $data, $schema, $state) {
911182384µs my $valid = 0;
921182305µs my @errors;
9311823.67ms foreach my $idx (0 .. $schema->{anyOf}->$#*) {
94 next if not $self->eval($data, $schema->{anyOf}[$idx],
95236533.5ms23654.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
961183557µs ++$valid;
9711831.36ms last if $state->{short_circuit};
98 }
99
10011826.69ms return 1 if $valid;
101 push $state->{errors}->@*, @errors;
102 return E($state, 'no subschemas are valid');
103}
104
1052173µs2112.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
sub _traverse_keyword_oneOf { shift->traverse_array_schemas(@_) }
# spent 12.6ms making 21 calls to JSON::Schema::Modern::Vocabulary::traverse_array_schemas, avg 598µs/call
106
1071525360µ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
sub _eval_keyword_oneOf ($self, $data, $schema, $state) {
10830593µs my (@valid, @errors);
109305863µs foreach my $idx (0 .. $schema->{oneOf}->$#*) {
110 next if not $self->eval($data, $schema->{oneOf}[$idx],
1116108.28ms6100s +{ %$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
112305219µs push @valid, $idx;
113305287µs last if @valid > 1 and $state->{short_circuit};
114 }
115
1163051.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
12715108µs151.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
sub _traverse_keyword_not { shift->traverse_subschema(@_) }
# 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
1292049µ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
sub _eval_keyword_not ($self, $data, $schema, $state) {
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},
133469µs40s 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
13865295µs6510.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
sub _traverse_keyword_if { shift->traverse_subschema(@_) }
# 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
13965228µs6517.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
sub _traverse_keyword_then { shift->traverse_subschema(@_) }
# 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
1401551µs152.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
sub _traverse_keyword_else { shift->traverse_subschema(@_) }
# spent 2.99ms making 15 calls to JSON::Schema::Modern::Vocabulary::traverse_subschema, avg 200µs/call
141
142150653.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
sub _eval_keyword_if ($self, $data, $schema, $state) {
143 return 1 if not exists $schema->{then} and not exists $schema->{else}
14430131.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},
148301356.1ms30130s 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
15230134.06ms return 1 if not exists $schema->{$keyword};
153 return 1 if $self->eval($data, $schema->{$keyword},
154221430.4ms22140s +{ %$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
158310µs30s
# 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
sub _traverse_keyword_dependentSchemas { shift->traverse_object_schemas(@_) }
# 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
1601525334µ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
sub _eval_keyword_dependentSchemas ($self, $data, $schema, $state) {
161305439µs305523µ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
163305134µs my $valid = 1;
1643051.44ms305169µ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
165305110µs next if not exists $data->{$property};
166
1672902.69ms5802.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) })) {
1692901.35ms next;
170 }
171
172 $valid = 0;
173 last if $state->{short_circuit};
174 }
175
17630583µs return E($state, 'not all dependencies are satisfied') if not $valid;
1773051.05ms return 1;
178}
179
180sub _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
204sub _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
234sub _traverse_keyword_prefixItems { shift->traverse_array_schemas(@_) }
235
236sub _eval_keyword_prefixItems { shift->_eval_keyword__items_array_schemas(@_) }
237
23839278µ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
sub _traverse_keyword_items ($self, $schema, $state) {
23998107µ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
24698617µs9887.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
24987902.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
sub _eval_keyword_items ($self, $data, $schema, $state) {
250 return $self->_eval_keyword__items_array_schemas($data, $schema, $state)
25117581.31ms if is_plain_arrayref($schema->{items});
252
25317588.35ms175821.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
256sub _traverse_keyword_additionalItems { shift->traverse_subschema(@_) }
257
258sub _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)
264sub _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)
29887902.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
sub _eval_keyword__items_schema ($self, $data, $schema, $state) {
29917586.95ms17588.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
300643848µs return 1 if ($state->{_last_items_index}//-1) == $data->$#*;
301
302643162µs my $valid = 1;
303
3046432.66ms foreach my $idx (($state->{_last_items_index}//-1)+1 .. $data->$#*) {
30516323.14ms163214.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
306189446µs189175µ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 {
312144326.2ms14430s 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} })) {
31514437.14ms next;
316 }
317
318 $valid = 0;
319 }
320 last if $state->{short_circuit};
321 }
322
323643956µs $state->{_last_items_index} = $data->$#*;
324
3256431.17ms64351.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',
327643180µs $state->{keyword} eq 'additionalItems' ? 'additional ' : '') if not $valid;
3286432.44ms return 1;
329}
330
331319µs3228µ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
sub _traverse_keyword_contains { shift->traverse_subschema(@_) }
# 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
333sub _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
3633871.96ms387257ms
# 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
sub _traverse_keyword_properties { shift->traverse_object_schemas(@_) }
# 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
36516246036.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
sub _eval_keyword_properties ($self, $data, $schema, $state) {
3663249278.2ms32492132ms 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
368286127.82ms my $valid = 1;
369286125.97ms my @properties;
37028612217ms2861254.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
37116696748.7ms next if not exists $data->{$property};
372110578.61ms push @properties, $property;
373
3741105719.1ms11057110ms if (is_type('boolean', $schema->{properties}{$property})) {
# spent 110ms making 11057 calls to JSON::Schema::Modern::Utilities::is_type, avg 10µs/call
375145558µs145366µ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 {
38010912171ms3273687.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) })) {
3831011354.1ms next;
384 }
385
386799403µs $valid = 0;
387 }
388799751µs last if $state->{short_circuit};
389 }
390
3912861251.8ms286122.17s A($state, \@properties);
# spent 2.17s making 28612 calls to JSON::Schema::Modern::Utilities::A, avg 76µs/call
3922861210.2ms799200ms 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
3932781387.5ms return 1;
394}
395
396245µ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
sub _traverse_keyword_patternProperties ($self, $schema, $state) {
39766µs619µ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
39962µs my $valid = 1;
400619µs61µ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
401632µs6233µ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
402620µs6895µ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 }
404615µs return $valid;
405}
406
407168454.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
sub _eval_keyword_patternProperties ($self, $data, $schema, $state) {
40833698.51ms336915.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
4103369709µs my $valid = 1;
4113369686µs my @properties;
412336914.3ms33691.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
4133369102ms2004137.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
41417991.02ms push @properties, $property;
41517992.58ms179918.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
41610612.40ms10611.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 {
42173811.3ms221410.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) })) {
4247386.21ms next;
425 }
426
427 $valid = 0;
428 }
429 last if $state->{short_circuit};
430 }
431 }
432
433336920.1ms6738283ms 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
4343369902µs return E($state, 'not all properties are valid') if not $valid;
435336912.2ms return 1;
436}
437
438130664µs13027.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
sub _traverse_keyword_additionalProperties { shift->traverse_subschema(@_) }
# 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
44048851.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
sub _eval_keyword_additionalProperties ($self, $data, $schema, $state) {
4419772.03ms9773.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
443977296µs my $valid = 1;
444977258µs my @properties;
4459778.80ms977715µs foreach my $property (sort keys %$data) {
# spent 715µs making 977 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 732ns/call
44618351.45ms next if exists $schema->{properties} and exists $schema->{properties}{$property};
447 next if exists $schema->{patternProperties}
4481835888µs and any { $property =~ /$_/ } keys $schema->{patternProperties}->%*;
449
45018351.67ms push @properties, $property;
45118352.95ms183518.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 {
457183527.5ms367015.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' })) {
460183510.2ms next;
461 }
462
463 $valid = 0;
464 }
465 last if $state->{short_circuit};
466 }
467
4689771.42ms97763.7ms A($state, \@properties);
# spent 63.7ms making 977 calls to JSON::Schema::Modern::Utilities::A, avg 65µs/call
469977254µs return E($state, 'not all additional properties are valid') if not $valid;
4709773.34ms return 1;
471}
472
4731489µs143.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
sub _traverse_keyword_propertyNames { shift->traverse_subschema(@_) }
# 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
4753135869µ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
sub _eval_keyword_propertyNames ($self, $data, $schema, $state) {
4766271.06ms6271.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
478627227µs my $valid = 1;
4796273.17ms627178µs foreach my $property (sort keys %$data) {
# spent 178µs making 627 calls to JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort, avg 284ns/call
4807139.02ms14266.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' })) {
4837132.72ms next;
484 }
485
486 $valid = 0;
487 last if $state->{short_circuit};
488 }
489
490627289µs return E($state, 'not all property names are valid') if not $valid;
4916271.86ms return 1;
492}
493
494119µs1;
495
496155µs1588µs__END__
 
# 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
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:match; # opcode
# 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
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:qr; # opcode
# 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
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:regcomp; # opcode
# 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
sub JSON::Schema::Modern::Vocabulary::Applicator::CORE:sort; # opcode
# spent 0s within JSON::Schema::Modern::Vocabulary::Applicator::__ANON__ which was called: # once (0s+0s) by JSON::Schema::Modern::Vocabulary::Applicator::BEGIN@21 at line 21
sub JSON::Schema::Modern::Vocabulary::Applicator::__ANON__; # xsub