Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Vocabulary/Validation.pm |
Statements | Executed 804128 statements in 919ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
35648 | 1 | 1 | 340ms | 896ms | _eval_keyword_type | JSON::Schema::Modern::Vocabulary::Validation::
94075 | 2 | 1 | 332ms | 332ms | keywords | JSON::Schema::Modern::Vocabulary::Validation::
4795 | 1 | 1 | 50.4ms | 446ms | _eval_keyword_required | JSON::Schema::Modern::Vocabulary::Validation::
1538 | 1 | 1 | 17.5ms | 218ms | _eval_keyword_enum | JSON::Schema::Modern::Vocabulary::Validation::
1208 | 1 | 1 | 13.1ms | 273ms | _eval_keyword_const | JSON::Schema::Modern::Vocabulary::Validation::
1381 | 1 | 1 | 12.8ms | 37.9ms | _traverse_keyword_type | JSON::Schema::Modern::Vocabulary::Validation::
1403 | 1 | 1 | 8.76ms | 80.0ms | _eval_keyword_uniqueItems | JSON::Schema::Modern::Vocabulary::Validation::
1244 | 1 | 1 | 6.51ms | 9.58ms | _eval_keyword_minItems | JSON::Schema::Modern::Vocabulary::Validation::
485 | 1 | 1 | 3.26ms | 4.38ms | _eval_keyword_minProperties | JSON::Schema::Modern::Vocabulary::Validation::
276 | 1 | 1 | 2.90ms | 73.9ms | _traverse_keyword_required | JSON::Schema::Modern::Vocabulary::Validation::
262 | 1 | 1 | 2.24ms | 6.07ms | _eval_keyword_pattern | JSON::Schema::Modern::Vocabulary::Validation::
262 | 1 | 1 | 720µs | 720µs | CORE:match (opcode) | JSON::Schema::Modern::Vocabulary::Validation::
69 | 1 | 1 | 554µs | 4.33ms | _traverse_keyword_pattern | JSON::Schema::Modern::Vocabulary::Validation::
87 | 8 | 1 | 514µs | 1.60ms | _assert_non_negative_integer | JSON::Schema::Modern::Vocabulary::Validation::
79 | 1 | 1 | 488µs | 1.42ms | _eval_keyword_minimum | JSON::Schema::Modern::Vocabulary::Validation::
60 | 1 | 1 | 424µs | 12.3ms | _traverse_keyword_enum | JSON::Schema::Modern::Vocabulary::Validation::
262 | 1 | 1 | 423µs | 423µs | CORE:regcomp (opcode) | JSON::Schema::Modern::Vocabulary::Validation::
50 | 1 | 1 | 185µs | 1.07ms | _traverse_keyword_minProperties | JSON::Schema::Modern::Vocabulary::Validation::
30 | 3 | 1 | 109µs | 430µs | _assert_number | JSON::Schema::Modern::Vocabulary::Validation::
95 | 1 | 1 | 108µs | 108µs | _traverse_keyword_const | JSON::Schema::Modern::Vocabulary::Validation::
15 | 1 | 1 | 86µs | 107µs | _eval_keyword_maxProperties | JSON::Schema::Modern::Vocabulary::Validation::
21 | 1 | 1 | 72µs | 368µs | _traverse_keyword_minimum | JSON::Schema::Modern::Vocabulary::Validation::
14 | 1 | 1 | 47µs | 265µs | _traverse_keyword_minItems | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 45µs | 60µs | _traverse_keyword_dependentRequired | JSON::Schema::Modern::Vocabulary::Validation::
8 | 1 | 1 | 30µs | 150µs | _traverse_keyword_maximum | JSON::Schema::Modern::Vocabulary::Validation::
8 | 1 | 1 | 26µs | 222µs | _traverse_keyword_maxLength | JSON::Schema::Modern::Vocabulary::Validation::
8 | 1 | 1 | 25µs | 176µs | _traverse_keyword_minLength | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 25µs | 28µs | BEGIN@1.310 | Module::Runtime::
1 | 1 | 1 | 20µs | 29µs | _traverse_keyword_maxItems | JSON::Schema::Modern::Vocabulary::Validation::
2 | 1 | 1 | 15µs | 66µs | _traverse_keyword_maxContains | JSON::Schema::Modern::Vocabulary::Validation::
3 | 1 | 1 | 14µs | 82µs | _traverse_keyword_maxProperties | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 12µs | 627µs | BEGIN@11 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 11µs | 7.67ms | BEGIN@19 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 10µs | 30µs | BEGIN@13 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 10µs | 20µs | BEGIN@15 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 10µs | 67µs | BEGIN@20 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 10µs | 309µs | BEGIN@21 | JSON::Schema::Modern::Vocabulary::Validation::
3 | 1 | 1 | 10µs | 76µs | _traverse_keyword_uniqueItems | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 9µs | 23µs | BEGIN@14 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 9µs | 9µs | BEGIN@9 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 7µs | 90µs | BEGIN@12 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 7µs | 36µs | BEGIN@17 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 6µs | 186µs | BEGIN@10 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 6µs | 14µs | BEGIN@16 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 6µs | 20µs | BEGIN@18 | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 6µs | 35µs | BEGIN@2.311 | Module::Runtime::
1 | 1 | 1 | 5µs | 19µs | _traverse_keyword_exclusiveMinimum | JSON::Schema::Modern::Vocabulary::Validation::
5 | 1 | 1 | 3µs | 3µs | evaluation_order | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 2µs | 18µs | _traverse_keyword_minContains | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 2µs | 2µs | vocabulary | JSON::Schema::Modern::Vocabulary::Validation::
1 | 1 | 1 | 0s | 0s | CORE:sort (opcode) | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | __ANON__[:264] | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | __ANON__[:49] | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | __ANON__[:56] | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | __ANON__[:67] | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | __ANON__[:86] | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_dependentRequired | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_exclusiveMaximum | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_exclusiveMinimum | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_maxContains | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_maxItems | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_maxLength | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_maximum | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_minContains | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_minLength | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _eval_keyword_multipleOf | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _traverse_keyword_exclusiveMaximum | JSON::Schema::Modern::Vocabulary::Validation::
0 | 0 | 0 | 0s | 0s | _traverse_keyword_multipleOf | JSON::Schema::Modern::Vocabulary::Validation::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 27µs | 2 | 31µs | # spent 28µs (25+3) within Module::Runtime::BEGIN@1.310 which was called:
# once (25µs+3µs) by Module::Runtime::require_module at line 1 # spent 28µs making 1 call to Module::Runtime::BEGIN@1.310
# spent 3µs making 1 call to strict::import |
2 | 2 | 33µs | 2 | 64µs | # spent 35µs (6+29) within Module::Runtime::BEGIN@2.311 which was called:
# once (6µs+29µs) by Module::Runtime::require_module at line 2 # spent 35µs making 1 call to Module::Runtime::BEGIN@2.311
# spent 29µs making 1 call to warnings::import |
3 | package JSON::Schema::Modern::Vocabulary::Validation; | ||||
4 | # vim: set ts=8 sts=2 sw=2 tw=100 et : | ||||
5 | # ABSTRACT: Implementation of the JSON Schema Validation vocabulary | ||||
6 | |||||
7 | 1 | 0s | our $VERSION = '0.552'; | ||
8 | |||||
9 | 2 | 27µs | 1 | 9µs | # spent 9µs within JSON::Schema::Modern::Vocabulary::Validation::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::Validation::BEGIN@9 |
10 | 2 | 18µs | 2 | 366µs | # spent 186µs (6+180) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@10 which was called:
# once (6µs+180µs) by Module::Runtime::require_module at line 10 # spent 186µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@10
# spent 180µs making 1 call to Moo::import |
11 | 3 | 25µs | 3 | 1.24ms | # spent 627µs (12+615) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@11 which was called:
# once (12µs+615µs) by Module::Runtime::require_module at line 11 # spent 627µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@11
# spent 600µs making 1 call to strictures::import
# spent 14µs making 1 call to strictures::VERSION |
12 | 2 | 31µs | 2 | 173µs | # spent 90µs (7+83) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@12 which was called:
# once (7µs+83µs) by Module::Runtime::require_module at line 12 # spent 90µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@12
# spent 83µs making 1 call to experimental::import |
13 | 2 | 22µs | 2 | 33µs | # spent 30µs (10+20) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@13 which was called:
# once (10µs+20µs) by Module::Runtime::require_module at line 13 # spent 30µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@13
# spent 3µs making 1 call to if::import |
14 | 2 | 18µs | 2 | 25µs | # spent 23µs (9+14) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@14 which was called:
# once (9µs+14µs) by Module::Runtime::require_module at line 14 # spent 23µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@14
# spent 2µs making 1 call to if::unimport |
15 | 2 | 16µs | 2 | 21µs | # spent 20µs (10+10) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@15 which was called:
# once (10µs+10µs) by Module::Runtime::require_module at line 15 # spent 20µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@15
# spent 1µs making 1 call to if::unimport |
16 | 2 | 12µs | 2 | 14µs | # spent 14µs (6+8) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@16 which was called:
# once (6µs+8µs) by Module::Runtime::require_module at line 16 # spent 14µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@16
# spent 0s making 1 call to if::unimport |
17 | 2 | 17µs | 2 | 43µs | # spent 36µs (7+29) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@17 which was called:
# once (7µs+29µs) by Module::Runtime::require_module at line 17 # spent 36µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@17
# spent 7µs making 1 call to List::Util::import |
18 | 3 | 29µs | 3 | 34µs | # spent 20µs (6+14) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@18 which was called:
# once (6µs+14µs) by Module::Runtime::require_module at line 18 # spent 20µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@18
# spent 7µs making 1 call to Exporter::import
# spent 7µs making 1 call to UNIVERSAL::VERSION |
19 | 2 | 67µs | 2 | 7.68ms | # spent 7.67ms (11µs+7.66) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@19 which was called:
# once (11µs+7.66ms) by Module::Runtime::require_module at line 19 # spent 7.67ms making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@19
# spent 1µs making 1 call to if::import |
20 | 2 | 28µs | 2 | 124µs | # spent 67µs (10+57) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@20 which was called:
# once (10µs+57µs) by Module::Runtime::require_module at line 20 # spent 67µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@20
# spent 57µs making 1 call to Exporter::import |
21 | 2 | 2.18ms | 2 | 608µs | # spent 309µs (10+299) within JSON::Schema::Modern::Vocabulary::Validation::BEGIN@21 which was called:
# once (10µs+299µs) by Module::Runtime::require_module at line 21 # spent 309µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::BEGIN@21
# spent 299µs making 1 call to namespace::clean::import |
22 | |||||
23 | 1 | 2µs | 1 | 457µs | with 'JSON::Schema::Modern::Vocabulary'; # spent 457µs making 1 call to Moo::with |
24 | |||||
25 | # spent 2µs within JSON::Schema::Modern::Vocabulary::Validation::vocabulary which was called:
# once (2µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:670] at line 666 of JSON/Schema/Modern.pm | ||||
26 | 1 | 3µs | 'https://json-schema.org/draft/2019-09/vocab/validation' => 'draft2019-09', | ||
27 | 'https://json-schema.org/draft/2020-12/vocab/validation' => 'draft2020-12'; | ||||
28 | } | ||||
29 | |||||
30 | 5 | 8µs | # spent 3µs within JSON::Schema::Modern::Vocabulary::Validation::evaluation_order which was called 5 times, avg 600ns/call:
# 5 times (3µs+0s) by JSON::Schema::Modern::Vocabulary::Core::CORE:sort at line 322 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 600ns/call | ||
31 | |||||
32 | 282225 | 54.5ms | # spent 332ms within JSON::Schema::Modern::Vocabulary::Validation::keywords which was called 94075 times, avg 4µs/call:
# 91595 times (325ms+0s) by JSON::Schema::Modern::_eval_subschema at line 535 of JSON/Schema/Modern.pm, avg 4µs/call
# 2480 times (7.89ms+0s) by JSON::Schema::Modern::_traverse_subschema at line 447 of JSON/Schema/Modern.pm, avg 3µs/call | ||
33 | return ( | ||||
34 | 94075 | 333ms | qw(type enum const | ||
35 | multipleOf maximum exclusiveMaximum minimum exclusiveMinimum | ||||
36 | maxLength minLength pattern | ||||
37 | maxItems minItems uniqueItems), | ||||
38 | $spec_version ne 'draft7' ? qw(maxContains minContains) : (), | ||||
39 | qw(maxProperties minProperties required), | ||||
40 | $spec_version ne 'draft7' ? 'dependentRequired' : (), | ||||
41 | ); | ||||
42 | } | ||||
43 | |||||
44 | 5524 | 836µs | # spent 37.9ms (12.8+25.1) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_type which was called 1381 times, avg 27µs/call:
# 1381 times (12.8ms+25.1ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 27µs/call | ||
45 | 1381 | 2.91ms | if (is_plain_arrayref($schema->{type})) { | ||
46 | 76 | 83µs | return E($state, 'type array is empty') if not $schema->{type}->@*; | ||
47 | 76 | 236µs | foreach my $type ($schema->{type}->@*) { | ||
48 | return E($state, 'unrecognized type "%s"', $type//'<null>') | ||||
49 | 692 | 855µs | 158 | 339µs | if not any { ($type//'') eq $_ } qw(null boolean object array string number integer); # spent 339µs making 158 calls to List::Util::any, avg 2µs/call |
50 | } | ||||
51 | 76 | 132µs | 76 | 3.15ms | return E($state, '"type" values are not unique') if not is_elements_unique($schema->{type}); # spent 3.15ms making 76 calls to JSON::Schema::Modern::Utilities::is_elements_unique, avg 42µs/call |
52 | } | ||||
53 | else { | ||||
54 | 1305 | 1.65ms | 1305 | 17.9ms | return if not assert_keyword_type($state, $schema, 'string'); # spent 17.9ms making 1305 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 14µs/call |
55 | return E($state, 'unrecognized type "%s"', $schema->{type}//'<null>') | ||||
56 | 6434 | 7.96ms | 1305 | 3.73ms | if not any { ($schema->{type}//'') eq $_ } qw(null boolean object array string number integer); # spent 3.73ms making 1305 calls to List::Util::any, avg 3µs/call |
57 | } | ||||
58 | 1381 | 2.11ms | return 1; | ||
59 | } | ||||
60 | |||||
61 | 178240 | 34.5ms | # spent 896ms (340+556) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_type which was called 35648 times, avg 25µs/call:
# 35648 times (340ms+556ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 25µs/call | ||
62 | 35648 | 56.5ms | 35648 | 186ms | my $type = get_type($data); # spent 186ms making 35648 calls to JSON::Schema::Modern::Utilities::get_type, avg 5µs/call |
63 | 35648 | 21.4ms | if (is_plain_arrayref($schema->{type})) { | ||
64 | return 1 if any { | ||||
65 | $type eq $_ or ($_ eq 'number' and $type eq 'integer') | ||||
66 | 26766 | 150ms | or ($_ eq 'boolean' and $state->{scalarref_booleans} and $type eq 'reference to SCALAR') | ||
67 | 23274 | 93.5ms | 23274 | 58.1ms | } $schema->{type}->@*; # spent 58.1ms making 23274 calls to List::Util::any, avg 2µs/call |
68 | return E($state, 'got %s, not one of %s', $type, join(', ', $schema->{type}->@*)); | ||||
69 | } | ||||
70 | else { | ||||
71 | return 1 if $type eq $schema->{type} or ($schema->{type} eq 'number' and $type eq 'integer') | ||||
72 | 12374 | 27.8ms | or ($schema->{type} eq 'boolean' and $state->{scalarref_booleans} and $type eq 'reference to SCALAR'); | ||
73 | 1115 | 4.83ms | 1115 | 312ms | return E($state, 'got %s, not %s', $type, $schema->{type}); # spent 312ms making 1115 calls to JSON::Schema::Modern::Utilities::E, avg 280µs/call |
74 | } | ||||
75 | } | ||||
76 | |||||
77 | 240 | 49µs | # spent 12.3ms (424µs+11.9) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_enum which was called 60 times, avg 205µs/call:
# 60 times (424µs+11.9ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 205µs/call | ||
78 | 60 | 60µs | 60 | 383µs | return if not assert_keyword_type($state, $schema, 'array'); # spent 383µs making 60 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 6µs/call |
79 | 60 | 138µs | 60 | 11.5ms | return E($state, '"enum" values are not unique') if not is_elements_unique($schema->{enum}); # spent 11.5ms making 60 calls to JSON::Schema::Modern::Utilities::is_elements_unique, avg 192µs/call |
80 | 60 | 139µs | return 1; | ||
81 | } | ||||
82 | |||||
83 | 7690 | 2.53ms | # spent 218ms (17.5+200) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_enum which was called 1538 times, avg 141µs/call:
# 1538 times (17.5ms+200ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 141µs/call | ||
84 | 3076 | 950µs | my @s; my $idx = 0; | ||
85 | 1538 | 2.64ms | my %s = ( scalarref_booleans => $state->{scalarref_booleans} ); | ||
86 | 9032 | 29.8ms | 9032 | 340ms | return 1 if any { is_equal($data, $_, $s[$idx++] = {%s}) } $schema->{enum}->@*; # spent 182ms making 1538 calls to List::Util::any, avg 118µs/call
# spent 158ms making 7494 calls to JSON::Schema::Modern::Utilities::is_equal, avg 21µs/call |
87 | return E($state, 'value does not match' | ||||
88 | .(!(grep $_->{path}, @s) ? '' | ||||
89 | 66 | 537µs | 66 | 18.1ms | : ' (differences start '.join(', ', map 'from item #'.$_.' at "'.$s[$_]->{path}.'"', 0..$#s).')')); # spent 18.1ms making 66 calls to JSON::Schema::Modern::Utilities::E, avg 275µs/call |
90 | } | ||||
91 | |||||
92 | 95 | 214µs | # spent 108µs within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_const which was called 95 times, avg 1µs/call:
# 95 times (108µs+0s) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 1µs/call | ||
93 | |||||
94 | 6040 | 1.70ms | # spent 273ms (13.1+260) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_const which was called 1208 times, avg 226µs/call:
# 1208 times (13.1ms+260ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 226µs/call | ||
95 | 1208 | 1.74ms | my %s = ( scalarref_booleans => $state->{scalarref_booleans} ); | ||
96 | 1208 | 4.63ms | 1208 | 43.2ms | return 1 if is_equal($data, $schema->{const}, my $s = { scalarref_booleans => $state->{scalarref_booleans} }); # spent 43.2ms making 1208 calls to JSON::Schema::Modern::Utilities::is_equal, avg 36µs/call |
97 | return E($state, 'value does not match' | ||||
98 | 799 | 4.53ms | 799 | 217ms | .($s->{path} ? ' (differences start at "'.$s->{path}.'")' : '')); # spent 217ms making 799 calls to JSON::Schema::Modern::Utilities::E, avg 271µs/call |
99 | } | ||||
100 | |||||
101 | sub _traverse_keyword_multipleOf ($self, $schema, $state) { | ||||
102 | return if not assert_keyword_type($state, $schema, 'number'); | ||||
103 | return E($state, 'multipleOf value is not a positive number') if $schema->{multipleOf} <= 0; | ||||
104 | return 1; | ||||
105 | } | ||||
106 | |||||
107 | sub _eval_keyword_multipleOf ($self, $data, $schema, $state) { | ||||
108 | return 1 if not is_type('number', $data); | ||||
109 | |||||
110 | # if either value is a float, use the bignum library for the calculation for an accurate remainder | ||||
111 | if (ref($data) =~ /^Math::Big(?:Int|Float)$/ or ref($schema->{multipleOf}) =~ /^Math::Big(?:Int|Float)$/) { | ||||
112 | $data = ref($data) =~ /^Math::Big(?:Int|Float)$/ ? $data->copy : Math::BigFloat->new($data); | ||||
113 | my $divisor = ref($schema->{multipleOf}) =~ /^Math::Big(?:Int|Float)$/ ? $schema->{multipleOf} : Math::BigFloat->new($schema->{multipleOf}); | ||||
114 | my ($quotient, $remainder) = $data->bdiv($divisor); | ||||
115 | return E($state, 'overflow while calculating quotient') if $quotient->is_inf; | ||||
116 | return 1 if $remainder == 0; | ||||
117 | } | ||||
118 | else { | ||||
119 | my $quotient = $data / $schema->{multipleOf}; | ||||
120 | return E($state, 'overflow while calculating quotient') | ||||
121 | if "$]" >= 5.022 ? isinf($quotient) : $quotient =~ /^-?Inf$/i; | ||||
122 | return 1 if int($quotient) == $quotient; | ||||
123 | } | ||||
124 | |||||
125 | return E($state, 'value is not a multiple of %s', sprintf_num($schema->{multipleOf})); | ||||
126 | } | ||||
127 | |||||
128 | 8 | 49µs | 8 | 120µs | # spent 150µs (30+120) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maximum which was called 8 times, avg 19µs/call:
# 8 times (30µs+120µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 19µs/call # spent 120µs making 8 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_number, avg 15µs/call |
129 | |||||
130 | sub _eval_keyword_maximum ($self, $data, $schema, $state) { | ||||
131 | return 1 if not is_type('number', $data); | ||||
132 | return 1 if $data <= $schema->{maximum}; | ||||
133 | return E($state, 'value is larger than %s', sprintf_num($schema->{maximum})); | ||||
134 | } | ||||
135 | |||||
136 | sub _traverse_keyword_exclusiveMaximum { shift->_assert_number(@_) } | ||||
137 | |||||
138 | sub _eval_keyword_exclusiveMaximum ($self, $data, $schema, $state) { | ||||
139 | return 1 if not is_type('number', $data); | ||||
140 | return 1 if $data < $schema->{exclusiveMaximum}; | ||||
141 | return E($state, 'value is equal to or larger than %s', sprintf_num($schema->{exclusiveMaximum})); | ||||
142 | } | ||||
143 | |||||
144 | 21 | 99µs | 21 | 296µs | # spent 368µs (72+296) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minimum which was called 21 times, avg 18µs/call:
# 21 times (72µs+296µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 18µs/call # spent 296µs making 21 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_number, avg 14µs/call |
145 | |||||
146 | 395 | 140µs | # spent 1.42ms (488µs+936µs) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_minimum which was called 79 times, avg 18µs/call:
# 79 times (488µs+936µs) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 18µs/call | ||
147 | 79 | 113µs | 79 | 936µs | return 1 if not is_type('number', $data); # spent 936µs making 79 calls to JSON::Schema::Modern::Utilities::is_type, avg 12µs/call |
148 | 79 | 253µs | return 1 if $data >= $schema->{minimum}; | ||
149 | return E($state, 'value is smaller than %s', sprintf_num($schema->{minimum})); | ||||
150 | } | ||||
151 | |||||
152 | 1 | 4µs | 1 | 14µs | # spent 19µs (5+14) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_exclusiveMinimum which was called:
# once (5µs+14µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm # spent 14µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::_assert_number |
153 | |||||
154 | sub _eval_keyword_exclusiveMinimum ($self, $data, $schema, $state) { | ||||
155 | return 1 if not is_type('number', $data); | ||||
156 | return 1 if $data > $schema->{exclusiveMinimum}; | ||||
157 | return E($state, 'value is equal to or smaller than %s', sprintf_num($schema->{exclusiveMinimum})); | ||||
158 | } | ||||
159 | |||||
160 | 8 | 36µs | 8 | 196µs | # spent 222µs (26+196) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxLength which was called 8 times, avg 28µs/call:
# 8 times (26µs+196µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 28µs/call # spent 196µs making 8 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer, avg 24µs/call |
161 | |||||
162 | sub _eval_keyword_maxLength ($self, $data, $schema, $state) { | ||||
163 | return 1 if not is_type('string', $data); | ||||
164 | return 1 if length($data) <= $schema->{maxLength}; | ||||
165 | return E($state, 'length is greater than %d', $schema->{maxLength}); | ||||
166 | } | ||||
167 | |||||
168 | 8 | 27µs | 8 | 151µs | # spent 176µs (25+151) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minLength which was called 8 times, avg 22µs/call:
# 8 times (25µs+151µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 22µs/call # spent 151µs making 8 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer, avg 19µs/call |
169 | |||||
170 | sub _eval_keyword_minLength ($self, $data, $schema, $state) { | ||||
171 | |||||
172 | return 1 if not is_type('string', $data); | ||||
173 | return 1 if length($data) >= $schema->{minLength}; | ||||
174 | return E($state, 'length is less than %d', $schema->{minLength}); | ||||
175 | } | ||||
176 | |||||
177 | 276 | 114µs | # spent 4.33ms (554µs+3.77) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_pattern which was called 69 times, avg 63µs/call:
# 69 times (554µs+3.77ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 63µs/call | ||
178 | return if not assert_keyword_type($state, $schema, 'string') | ||||
179 | 69 | 243µs | 138 | 3.77ms | or not assert_pattern($state, $schema->{pattern}); # spent 2.91ms making 69 calls to JSON::Schema::Modern::Utilities::assert_pattern, avg 42µs/call
# spent 866µs making 69 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 13µs/call |
180 | 69 | 148µs | return 1; | ||
181 | } | ||||
182 | |||||
183 | 1310 | 279µs | # spent 6.07ms (2.24+3.82) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_pattern which was called 262 times, avg 23µs/call:
# 262 times (2.24ms+3.82ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 23µs/call | ||
184 | 262 | 369µs | 262 | 2.68ms | return 1 if not is_type('string', $data); # spent 2.68ms making 262 calls to JSON::Schema::Modern::Utilities::is_type, avg 10µs/call |
185 | |||||
186 | 262 | 2.57ms | 524 | 1.14ms | return 1 if $data =~ m/$schema->{pattern}/; # spent 720µs making 262 calls to JSON::Schema::Modern::Vocabulary::Validation::CORE:match, avg 3µs/call
# spent 423µs making 262 calls to JSON::Schema::Modern::Vocabulary::Validation::CORE:regcomp, avg 2µs/call |
187 | return E($state, 'pattern does not match'); | ||||
188 | } | ||||
189 | |||||
190 | 1 | 3µs | 1 | 9µs | # spent 29µs (20+9) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxItems which was called:
# once (20µs+9µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm # spent 9µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer |
191 | |||||
192 | sub _eval_keyword_maxItems ($self, $data, $schema, $state) { | ||||
193 | return 1 if not is_type('array', $data); | ||||
194 | return 1 if @$data <= $schema->{maxItems}; | ||||
195 | return E($state, 'more than %d item%s', $schema->{maxItems}, $schema->{maxItems} > 1 ? 's' : ''); | ||||
196 | } | ||||
197 | |||||
198 | 14 | 84µs | 14 | 218µs | # spent 265µs (47+218) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minItems which was called 14 times, avg 19µs/call:
# 14 times (47µs+218µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 19µs/call # spent 218µs making 14 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer, avg 16µs/call |
199 | |||||
200 | 6220 | 1.69ms | # spent 9.58ms (6.51+3.07) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_minItems which was called 1244 times, avg 8µs/call:
# 1244 times (6.51ms+3.07ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 8µs/call | ||
201 | 1244 | 4.17ms | 1244 | 3.08ms | return 1 if not is_type('array', $data); # spent 3.08ms making 1244 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call |
202 | 129 | 329µs | return 1 if @$data >= $schema->{minItems}; | ||
203 | return E($state, 'fewer than %d item%s', $schema->{minItems}, $schema->{minItems} > 1 ? 's' : ''); | ||||
204 | } | ||||
205 | |||||
206 | 12 | 3µs | # spent 76µs (10+66) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_uniqueItems which was called 3 times, avg 25µs/call:
# 3 times (10µs+66µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 25µs/call | ||
207 | 3 | 1µs | 3 | 66µs | return if not assert_keyword_type($state, $schema, 'boolean'); # spent 66µs making 3 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 22µs/call |
208 | 3 | 6µs | return 1; | ||
209 | } | ||||
210 | |||||
211 | 7015 | 1.49ms | # spent 80.0ms (8.76+71.2) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_uniqueItems which was called 1403 times, avg 57µs/call:
# 1403 times (8.76ms+71.2ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 57µs/call | ||
212 | 1403 | 3.62ms | 1403 | 2.02ms | return 1 if not is_type('array', $data); # spent 2.02ms making 1403 calls to JSON::Schema::Modern::Utilities::is_type, avg 1µs/call |
213 | 288 | 1.12ms | 288 | 793µs | return 1 if not $schema->{uniqueItems}; # spent 793µs making 288 calls to JSON::PP::Boolean::__ANON__[JSON/PP/Boolean.pm:7], avg 3µs/call |
214 | 288 | 1.23ms | 288 | 68.4ms | return 1 if is_elements_unique($data, my $equal_indices = []); # spent 68.4ms making 288 calls to JSON::Schema::Modern::Utilities::is_elements_unique, avg 238µs/call |
215 | return E($state, 'items at indices %d and %d are not unique', @$equal_indices); | ||||
216 | } | ||||
217 | |||||
218 | # Note: no effort is made to check if the 'contains' keyword has been disabled via its vocabulary. | ||||
219 | 2 | 11µs | 2 | 51µs | # spent 66µs (15+51) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxContains which was called 2 times, avg 33µs/call:
# 2 times (15µs+51µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 33µs/call # spent 51µs making 2 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer, avg 26µs/call |
220 | |||||
221 | sub _eval_keyword_maxContains ($self, $data, $schema, $state) { | ||||
222 | return 1 if not exists $state->{_num_contains}; | ||||
223 | return 1 if not is_type('array', $data); | ||||
224 | |||||
225 | return E($state, 'contains too many matching items') | ||||
226 | if $state->{_num_contains} > $schema->{maxContains}; | ||||
227 | |||||
228 | return 1; | ||||
229 | } | ||||
230 | |||||
231 | 1 | 3µs | 1 | 16µs | # spent 18µs (2+16) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minContains which was called:
# once (2µs+16µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm # spent 16µs making 1 call to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer |
232 | |||||
233 | sub _eval_keyword_minContains ($self, $data, $schema, $state) { | ||||
234 | return 1 if not exists $state->{_num_contains}; | ||||
235 | return 1 if not is_type('array', $data); | ||||
236 | |||||
237 | return E($state, 'contains too few matching items') | ||||
238 | if $state->{_num_contains} < $schema->{minContains}; | ||||
239 | |||||
240 | return 1; | ||||
241 | } | ||||
242 | |||||
243 | 3 | 18µs | 3 | 68µs | # spent 82µs (14+68) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxProperties which was called 3 times, avg 27µs/call:
# 3 times (14µs+68µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 27µs/call # spent 68µs making 3 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer, avg 23µs/call |
244 | |||||
245 | 75 | 16µs | # spent 107µs (86+21) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_maxProperties which was called 15 times, avg 7µs/call:
# 15 times (86µs+21µs) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 7µs/call | ||
246 | 15 | 16µs | 15 | 21µs | return 1 if not is_type('object', $data); # spent 21µs making 15 calls to JSON::Schema::Modern::Utilities::is_type, avg 1µs/call |
247 | 15 | 41µs | return 1 if keys %$data <= $schema->{maxProperties}; | ||
248 | return E($state, 'more than %d propert%s', $schema->{maxProperties}, | ||||
249 | $schema->{maxProperties} > 1 ? 'ies' : 'y'); | ||||
250 | } | ||||
251 | |||||
252 | 50 | 200µs | 50 | 887µs | # spent 1.07ms (185µs+887µs) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minProperties which was called 50 times, avg 21µs/call:
# 50 times (185µs+887µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 21µs/call # spent 887µs making 50 calls to JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer, avg 18µs/call |
253 | |||||
254 | 2425 | 620µs | # spent 4.38ms (3.26+1.12) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_minProperties which was called 485 times, avg 9µs/call:
# 485 times (3.26ms+1.12ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 9µs/call | ||
255 | 485 | 684µs | 485 | 1.12ms | return 1 if not is_type('object', $data); # spent 1.12ms making 485 calls to JSON::Schema::Modern::Utilities::is_type, avg 2µs/call |
256 | 485 | 1.61ms | return 1 if keys %$data >= $schema->{minProperties}; | ||
257 | return E($state, 'fewer than %d propert%s', $schema->{minProperties}, | ||||
258 | $schema->{minProperties} > 1 ? 'ies' : 'y'); | ||||
259 | } | ||||
260 | |||||
261 | 1104 | 178µs | # spent 73.9ms (2.90+71.0) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_required which was called 276 times, avg 268µs/call:
# 276 times (2.90ms+71.0ms) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm, avg 268µs/call | ||
262 | 276 | 248µs | 276 | 1.36ms | return if not assert_keyword_type($state, $schema, 'array'); # spent 1.36ms making 276 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 5µs/call |
263 | return E($state, '"required" element is not a string') | ||||
264 | 1051 | 2.09ms | 1051 | 9.13ms | if any { !is_type('string', $_) } $schema->{required}->@*; # spent 5.29ms making 276 calls to List::Util::any, avg 19µs/call
# spent 3.84ms making 775 calls to JSON::Schema::Modern::Utilities::is_type, avg 5µs/call |
265 | 276 | 473µs | 276 | 64.3ms | return E($state, '"required" values are not unique') if not is_elements_unique($schema->{required}); # spent 64.3ms making 276 calls to JSON::Schema::Modern::Utilities::is_elements_unique, avg 233µs/call |
266 | 276 | 476µs | return 1; | ||
267 | } | ||||
268 | |||||
269 | 23975 | 5.46ms | # spent 446ms (50.4+395) within JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_required which was called 4795 times, avg 93µs/call:
# 4795 times (50.4ms+395ms) by JSON::Schema::Modern::_eval_subschema at line 548 of JSON/Schema/Modern.pm, avg 93µs/call | ||
270 | 4795 | 7.00ms | 4795 | 12.4ms | return 1 if not is_type('object', $data); # spent 12.4ms making 4795 calls to JSON::Schema::Modern::Utilities::is_type, avg 3µs/call |
271 | |||||
272 | 4795 | 17.8ms | my @missing = grep !exists $data->{$_}, $schema->{required}->@*; | ||
273 | 4795 | 8.51ms | return 1 if not @missing; | ||
274 | 1438 | 8.48ms | 1438 | 383ms | return E($state, 'missing propert%s: %s', @missing > 1 ? 'ies' : 'y', join(', ', @missing)); # spent 383ms making 1438 calls to JSON::Schema::Modern::Utilities::E, avg 266µs/call |
275 | } | ||||
276 | |||||
277 | 4 | 8µs | # spent 60µs (45+15) within JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_dependentRequired which was called:
# once (45µs+15µs) by JSON::Schema::Modern::_traverse_subschema at line 457 of JSON/Schema/Modern.pm | ||
278 | 1 | 2µs | 1 | 6µs | return if not assert_keyword_type($state, $schema, 'object'); # spent 6µs making 1 call to JSON::Schema::Modern::Utilities::assert_keyword_type |
279 | |||||
280 | 1 | 2µs | my $valid = 1; | ||
281 | 1 | 11µs | 1 | 0s | foreach my $property (sort keys $schema->{dependentRequired}->%*) { # spent 0s making 1 call to JSON::Schema::Modern::Vocabulary::Validation::CORE:sort |
282 | $valid = E({ %$state, _schema_path_suffix => $property }, 'value is not an array'), next | ||||
283 | 1 | 1µs | 1 | 1µs | if not is_type('array', $schema->{dependentRequired}{$property}); # spent 1µs making 1 call to JSON::Schema::Modern::Utilities::is_type |
284 | |||||
285 | 1 | 4µs | foreach my $index (0..$schema->{dependentRequired}{$property}->$#*) { | ||
286 | $valid = E({ %$state, _schema_path_suffix => [ $property, $index ] }, 'element #%d is not a string', $index) | ||||
287 | 1 | 2µs | 1 | 5µs | if not is_type('string', $schema->{dependentRequired}{$property}[$index]); # spent 5µs making 1 call to JSON::Schema::Modern::Utilities::is_type |
288 | } | ||||
289 | |||||
290 | $valid = E({ %$state, _schema_path_suffix => $property }, 'elements are not unique') | ||||
291 | 1 | 3µs | 1 | 3µs | if not is_elements_unique($schema->{dependentRequired}{$property}); # spent 3µs making 1 call to JSON::Schema::Modern::Utilities::is_elements_unique |
292 | } | ||||
293 | 1 | 4µs | return $valid; | ||
294 | } | ||||
295 | |||||
296 | sub _eval_keyword_dependentRequired ($self, $data, $schema, $state) { | ||||
297 | return 1 if not is_type('object', $data); | ||||
298 | |||||
299 | my $valid = 1; | ||||
300 | foreach my $property (sort keys $schema->{dependentRequired}->%*) { | ||||
301 | next if not exists $data->{$property}; | ||||
302 | |||||
303 | if (my @missing = grep !exists($data->{$_}), $schema->{dependentRequired}{$property}->@*) { | ||||
304 | $valid = E({ %$state, _schema_path_suffix => $property }, | ||||
305 | 'missing propert%s: %s', @missing > 1 ? 'ies' : 'y', join(', ', @missing)); | ||||
306 | } | ||||
307 | } | ||||
308 | |||||
309 | return 1 if $valid; | ||||
310 | return E($state, 'not all dependencies are satisfied'); | ||||
311 | } | ||||
312 | |||||
313 | 120 | 32µs | # spent 430µs (109+321) within JSON::Schema::Modern::Vocabulary::Validation::_assert_number which was called 30 times, avg 14µs/call:
# 21 times (79µs+217µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minimum at line 144, avg 14µs/call
# 8 times (27µs+93µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maximum at line 128, avg 15µs/call
# once (3µs+11µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_exclusiveMinimum at line 152 | ||
314 | 30 | 23µs | 30 | 321µs | return if not assert_keyword_type($state, $schema, 'number'); # spent 321µs making 30 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 11µs/call |
315 | 30 | 51µs | return 1; | ||
316 | } | ||||
317 | |||||
318 | 348 | 83µs | # spent 1.60ms (514µs+1.08) within JSON::Schema::Modern::Vocabulary::Validation::_assert_non_negative_integer which was called 87 times, avg 18µs/call:
# 50 times (294µs+593µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minProperties at line 252, avg 18µs/call
# 14 times (68µs+150µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minItems at line 198, avg 16µs/call
# 8 times (74µs+122µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxLength at line 160, avg 24µs/call
# 8 times (38µs+113µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minLength at line 168, avg 19µs/call
# 3 times (20µs+48µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxProperties at line 243, avg 23µs/call
# 2 times (14µs+37µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxContains at line 219, avg 26µs/call
# once (3µs+13µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_minContains at line 231
# once (3µs+6µs) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_maxItems at line 190 | ||
319 | 87 | 135µs | 87 | 1.08ms | return if not assert_keyword_type($state, $schema, 'integer'); # spent 1.08ms making 87 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 12µs/call |
320 | return E($state, '%s value is not a non-negative integer', $state->{keyword}) | ||||
321 | 87 | 77µs | if $schema->{$state->{keyword}} < 0; | ||
322 | 87 | 237µs | return 1; | ||
323 | } | ||||
324 | |||||
325 | 1 | 6µs | 1; | ||
326 | |||||
327 | 1 | 31µs | 1 | 391µs | __END__ # spent 391µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:26] |
# spent 720µs within JSON::Schema::Modern::Vocabulary::Validation::CORE:match which was called 262 times, avg 3µs/call:
# 262 times (720µs+0s) by JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_pattern at line 186, avg 3µs/call | |||||
# spent 423µs within JSON::Schema::Modern::Vocabulary::Validation::CORE:regcomp which was called 262 times, avg 2µs/call:
# 262 times (423µs+0s) by JSON::Schema::Modern::Vocabulary::Validation::_eval_keyword_pattern at line 186, avg 2µs/call | |||||
# spent 0s within JSON::Schema::Modern::Vocabulary::Validation::CORE:sort which was called:
# once (0s+0s) by JSON::Schema::Modern::Vocabulary::Validation::_traverse_keyword_dependentRequired at line 281 |