Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Vocabulary.pm |
Statements | Executed 683022 statements in 1.27s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
41707 | 2 | 1 | 1.03s | 97.2s | eval_subschema_at_uri (recurses: max depth 38, inclusive time 1064s) | JSON::Schema::Modern::Vocabulary::
49887 | 12 | 1 | 288ms | 97.0s | eval (recurses: max depth 34, inclusive time 949s) | JSON::Schema::Modern::Vocabulary::
401 | 3 | 2 | 16.3ms | 367ms | traverse_object_schemas (recurses: max depth 3, inclusive time 91.8ms) | JSON::Schema::Modern::Vocabulary::
561 | 10 | 3 | 4.37ms | 165ms | traverse_subschema (recurses: max depth 2, inclusive time 28.0ms) | JSON::Schema::Modern::Vocabulary::
77 | 3 | 1 | 2.28ms | 57.4ms | traverse_array_schemas (recurses: max depth 2, inclusive time 2.37ms) | JSON::Schema::Modern::Vocabulary::
401 | 1 | 1 | 485µs | 485µs | CORE:sort (opcode) | JSON::Schema::Modern::Vocabulary::
7 | 1 | 1 | 74µs | 1.33ms | traverse_property_schema | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 42µs | 46µs | BEGIN@1.304 | Moo::_Utils::
1 | 1 | 1 | 19µs | 770µs | BEGIN@11 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 15µs | 15µs | BEGIN@9 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 13µs | 358µs | BEGIN@10 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 12µs | 32µs | BEGIN@13 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 10µs | 27µs | BEGIN@14 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 10µs | 38µs | BEGIN@17 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 9µs | 46µs | BEGIN@2.305 | Moo::_Utils::
1 | 1 | 1 | 7µs | 95µs | BEGIN@12 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 7µs | 13µs | BEGIN@16 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 6µs | 17µs | BEGIN@15 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 6µs | 27µs | BEGIN@18 | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 6µs | 195µs | BEGIN@20 | JSON::Schema::Modern::Vocabulary::
3 | 1 | 1 | 2µs | 2µs | evaluation_order | JSON::Schema::Modern::Vocabulary::
1 | 1 | 1 | 1µs | 1µs | BEGIN@19 | JSON::Schema::Modern::Vocabulary::
0 | 0 | 0 | 0s | 0s | traverse | JSON::Schema::Modern::Vocabulary::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | 2 | 50µs | 2 | 50µs | # spent 46µs (42+4) within Moo::_Utils::BEGIN@1.304 which was called:
# once (42µs+4µs) by Moo::_Utils::_require at line 1 # spent 46µs making 1 call to Moo::_Utils::BEGIN@1.304
# spent 4µs making 1 call to strict::import |
2 | 2 | 56µs | 2 | 83µs | # spent 46µs (9+37) within Moo::_Utils::BEGIN@2.305 which was called:
# once (9µs+37µs) by Moo::_Utils::_require at line 2 # spent 46µs making 1 call to Moo::_Utils::BEGIN@2.305
# spent 37µs making 1 call to warnings::import |
3 | package JSON::Schema::Modern::Vocabulary; | ||||
4 | # vim: set ts=8 sts=2 sw=2 tw=100 et : | ||||
5 | # ABSTRACT: Base role for JSON Schema vocabulary classes | ||||
6 | |||||
7 | 1 | 1µs | our $VERSION = '0.552'; | ||
8 | |||||
9 | 2 | 40µs | 1 | 15µs | # spent 15µs within JSON::Schema::Modern::Vocabulary::BEGIN@9 which was called:
# once (15µs+0s) by Moo::_Utils::_require at line 9 # spent 15µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@9 |
10 | 2 | 31µs | 2 | 379µs | # spent 358µs (13+345) within JSON::Schema::Modern::Vocabulary::BEGIN@10 which was called:
# once (13µs+345µs) by Moo::_Utils::_require at line 10 # spent 358µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@10
# spent 21µs making 1 call to Moo::Role::import |
11 | 3 | 34µs | 3 | 1.52ms | # spent 770µs (19+751) within JSON::Schema::Modern::Vocabulary::BEGIN@11 which was called:
# once (19µs+751µs) by Moo::_Utils::_require at line 11 # spent 770µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@11
# spent 732µs making 1 call to strictures::import
# spent 19µs making 1 call to strictures::VERSION |
12 | 2 | 33µs | 2 | 183µs | # spent 95µs (7+88) within JSON::Schema::Modern::Vocabulary::BEGIN@12 which was called:
# once (7µs+88µs) by Moo::_Utils::_require at line 12 # spent 95µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@12
# spent 88µs making 1 call to experimental::import |
13 | 2 | 31µs | 2 | 33µs | # spent 32µs (12+20) within JSON::Schema::Modern::Vocabulary::BEGIN@13 which was called:
# once (12µs+20µs) by Moo::_Utils::_require at line 13 # spent 32µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@13
# spent 1µs making 1 call to if::import |
14 | 2 | 20µs | 2 | 29µs | # spent 27µs (10+17) within JSON::Schema::Modern::Vocabulary::BEGIN@14 which was called:
# once (10µs+17µs) by Moo::_Utils::_require at line 14 # spent 27µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@14
# spent 2µs making 1 call to if::unimport |
15 | 2 | 18µs | 2 | 18µs | # spent 17µs (6+11) within JSON::Schema::Modern::Vocabulary::BEGIN@15 which was called:
# once (6µs+11µs) by Moo::_Utils::_require at line 15 # spent 17µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@15
# spent 1µs making 1 call to if::unimport |
16 | 2 | 16µs | 2 | 13µs | # spent 13µs (7+6) within JSON::Schema::Modern::Vocabulary::BEGIN@16 which was called:
# once (7µs+6µs) by Moo::_Utils::_require at line 16 # spent 13µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@16
# spent 0s making 1 call to if::unimport |
17 | 3 | 34µs | 3 | 66µs | # spent 38µs (10+28) within JSON::Schema::Modern::Vocabulary::BEGIN@17 which was called:
# once (10µs+28µs) by Moo::_Utils::_require at line 17 # spent 38µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@17
# spent 23µs making 1 call to Exporter::import
# spent 5µs making 1 call to UNIVERSAL::VERSION |
18 | 2 | 14µs | 2 | 48µs | # spent 27µs (6+21) within JSON::Schema::Modern::Vocabulary::BEGIN@18 which was called:
# once (6µs+21µs) by Moo::_Utils::_require at line 18 # spent 27µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@18
# spent 21µs making 1 call to Exporter::import |
19 | 2 | 11µs | 1 | 1µs | # spent 1µs within JSON::Schema::Modern::Vocabulary::BEGIN@19 which was called:
# once (1µs+0s) by Moo::_Utils::_require at line 19 # spent 1µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@19 |
20 | 2 | 746µs | 2 | 384µs | # spent 195µs (6+189) within JSON::Schema::Modern::Vocabulary::BEGIN@20 which was called:
# once (6µs+189µs) by Moo::_Utils::_require at line 20 # spent 195µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@20
# spent 189µs making 1 call to namespace::clean::import |
21 | |||||
22 | 1 | 1µs | our @CARP_NOT = qw(JSON::Schema::Modern); | ||
23 | |||||
24 | 1 | 1µs | 1 | 9µs | requires qw(vocabulary keywords); # spent 9µs making 1 call to Moo::Role::requires |
25 | |||||
26 | 3 | 4µs | # spent 2µs within JSON::Schema::Modern::Vocabulary::evaluation_order which was called 3 times, avg 667ns/call:
# 3 times (2µs+0s) by JSON::Schema::Modern::Vocabulary::Core::CORE:sort at line 322 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 667ns/call | ||
27 | |||||
28 | sub traverse ($self, $schema, $state) { | ||||
29 | $state->{evaluator}->_traverse_subschema($schema, $state); | ||||
30 | } | ||||
31 | |||||
32 | 2244 | 355µs | # spent 165ms (4.37+161) within JSON::Schema::Modern::Vocabulary::traverse_subschema which was called 561 times, avg 295µs/call:
# 156 times (1.16ms+2.15ms) by JSON::Schema::Modern::Vocabulary::Unevaluated::_traverse_keyword_unevaluatedProperties at line 107 of JSON/Schema/Modern/Vocabulary/Unevaluated.pm, avg 21µs/call
# 130 times (1.11ms+29.8ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties at line 487 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 238µs/call
# 98 times (987µs+93.3ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items at line 269 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 962µs/call
# 65 times (375µs+15.7ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then at line 150 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 247µs/call
# 65 times (451µs+11.8ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if at line 149 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 188µs/call
# 15 times (86µs+3.55ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else at line 151 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 242µs/call
# 14 times (89µs+3.41ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames at line 527 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 250µs/call
# 14 times (84µs+1.03ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not at line 138 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 79µs/call
# 3 times (23µs+252µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains at line 366 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 92µs/call
# once (12µs+142µs) by JSON::Schema::Modern::Vocabulary::Content::_traverse_keyword_contentSchema at line 84 of JSON/Schema/Modern/Vocabulary/Content.pm | ||
33 | $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}, | ||||
34 | 561 | 4.09ms | 561 | 0s | +{ %$state, schema_path => $state->{schema_path}.'/'.$state->{keyword} }); # spent 189ms making 561 calls to JSON::Schema::Modern::_traverse_subschema, avg 337µs/call, recursion: max depth 6, sum of overlapping time 189ms |
35 | } | ||||
36 | |||||
37 | 308 | 73µs | # spent 57.4ms (2.28+55.2) within JSON::Schema::Modern::Vocabulary::traverse_array_schemas which was called 77 times, avg 746µs/call:
# 32 times (980µs+16.4ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf at line 93 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 543µs/call
# 23 times (716µs+23.5ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf at line 68 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 1.05ms/call
# 22 times (588µs+15.2ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf at line 110 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 718µs/call | ||
38 | 77 | 107µs | 77 | 675µs | return if not assert_keyword_type($state, $schema, 'array'); # spent 675µs making 77 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 9µs/call |
39 | 77 | 83µs | return E($state, '%s array is empty', $state->{keyword}) if not $schema->{$state->{keyword}}->@*; | ||
40 | |||||
41 | 77 | 25µs | my $valid = 1; | ||
42 | 77 | 227µs | foreach my $idx (0 .. $schema->{$state->{keyword}}->$#*) { | ||
43 | $valid = 0 if not $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}[$idx], | ||||
44 | 205 | 1.52ms | 205 | 0s | +{ %$state, schema_path => $state->{schema_path}.'/'.$state->{keyword}.'/'.$idx }); # spent 56.9ms making 205 calls to JSON::Schema::Modern::_traverse_subschema, avg 277µs/call, recursion: max depth 6, sum of overlapping time 56.9ms |
45 | } | ||||
46 | 77 | 245µs | return $valid; | ||
47 | } | ||||
48 | |||||
49 | 1604 | 255µs | # spent 367ms (16.3+350) within JSON::Schema::Modern::Vocabulary::traverse_object_schemas which was called 401 times, avg 915µs/call:
# 387 times (15.5ms+270ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties at line 402 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 739µs/call
# 12 times (785µs+80.1ms) by JSON::Schema::Modern::Vocabulary::Core::_traverse_keyword_defs at line 283 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 6.74ms/call
# 2 times (28µs+-28µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas at line 169 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call | ||
50 | 401 | 637µs | 401 | 3.21ms | return if not assert_keyword_type($state, $schema, 'object'); # spent 3.21ms making 401 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 8µs/call |
51 | |||||
52 | 401 | 151µs | my $valid = 1; | ||
53 | 401 | 3.02ms | 401 | 485µs | foreach my $property (sort keys $schema->{$state->{keyword}}->%*) { # spent 485µs making 401 calls to JSON::Schema::Modern::Vocabulary::CORE:sort, avg 1µs/call |
54 | $valid = 0 if not $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}{$property}, | ||||
55 | 1340 | 10.5ms | 2680 | 11.7ms | +{ %$state, schema_path => jsonp($state->{schema_path}, $state->{keyword}, $property) }); # spent 11.7ms making 1340 calls to JSON::Schema::Modern::Utilities::jsonp, avg 9µs/call
# spent 427ms making 1340 calls to JSON::Schema::Modern::_traverse_subschema, avg 319µs/call, recursion: max depth 6, sum of overlapping time 427ms |
56 | } | ||||
57 | 401 | 868µs | return $valid; | ||
58 | } | ||||
59 | |||||
60 | 35 | 4µs | # spent 1.33ms (74µs+1.26) within JSON::Schema::Modern::Vocabulary::traverse_property_schema which was called 7 times, avg 190µs/call:
# 7 times (74µs+1.26ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties at line 446 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 190µs/call | ||
61 | 7 | 14µs | 7 | 35µs | return if not assert_keyword_type($state, $schema, 'object'); # spent 35µs making 7 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 5µs/call |
62 | |||||
63 | $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}{$property}, | ||||
64 | 7 | 50µs | 14 | 58µs | +{ %$state, schema_path => jsonp($state->{schema_path}, $state->{keyword}, $property) }); # spent 58µs making 7 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call
# spent 1.16ms making 7 calls to JSON::Schema::Modern::_traverse_subschema, avg 166µs/call, recursion: max depth 2, sum of overlapping time 1.16ms |
65 | } | ||||
66 | |||||
67 | 249435 | 65.1ms | # spent 97.0s (288ms+96.7) within JSON::Schema::Modern::Vocabulary::eval which was called 49887 times, avg 1.94ms/call:
# 25750 times (131ms+-131ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf at line 76 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 10442 times (81.2ms+96.9s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties at line 421 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 9.29ms/call
# 3013 times (16.2ms+-16.2ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if at line 159 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 2365 times (11.8ms+-7.68ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf at line 100 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 2µs/call
# 2214 times (9.48ms+-9.48ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if at line 165 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 1835 times (11.3ms+-11.3ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties at line 508 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 1443 times (9.23ms+-9.23ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema at line 344 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 1208 times (9.43ms+-9.43ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 467 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 713 times (3.88ms+-3.88ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames at line 537 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 610 times (3.13ms+-3.13ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf at line 120 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 290 times (1.35ms+-1.35ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas at line 181 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
# 4 times (20µs+-20µs) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not at line 144 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call | ||
68 | 49887 | 235ms | 49887 | 0s | $state->{evaluator}->_eval_subschema($data, $schema, $state); # spent 1046s making 49887 calls to JSON::Schema::Modern::_eval_subschema, avg 21.0ms/call, recursion: max depth 73, sum of overlapping time 1046s |
69 | } | ||||
70 | |||||
71 | 250242 | 45.7ms | # spent 97.2s (1.03+96.2) within JSON::Schema::Modern::Vocabulary::eval_subschema_at_uri which was called 41707 times, avg 2.33ms/call:
# 39121 times (963ms+96.3s) by JSON::Schema::Modern::Vocabulary::Core::_eval_keyword_ref at line 201 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 2.49ms/call
# 2586 times (63.6ms+-63.6ms) by JSON::Schema::Modern::Vocabulary::Core::_eval_keyword_dynamicRef at line 243 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 0s/call | ||
72 | 41707 | 93.1ms | 41707 | 18.2s | my $schema_info = $state->{evaluator}->_fetch_from_uri($uri); # spent 18.2s making 41707 calls to JSON::Schema::Modern::_fetch_from_uri, avg 435µs/call |
73 | 41707 | 11.4ms | abort($state, 'EXCEPTION: unable to find resource %s', $uri) if not $schema_info; | ||
74 | |||||
75 | return $state->{evaluator}->_eval_subschema($data, $schema_info->{schema}, | ||||
76 | +{ | ||||
77 | $schema_info->{configs}->%*, | ||||
78 | %$state, | ||||
79 | traversed_schema_path => $state->{traversed_schema_path}.$state->{schema_path} | ||||
80 | .jsonp('', $state->{keyword}, exists $state->{_schema_path_suffix} | ||||
81 | ? (is_plain_arrayref($state->{_schema_path_suffix}) ? $state->{_schema_path_suffix}->@* : $state->{_schema_path_suffix}) | ||||
82 | : ()), | ||||
83 | initial_schema_uri => $schema_info->{canonical_uri}, | ||||
84 | document => $schema_info->{document}, | ||||
85 | document_path => $schema_info->{document_path}, | ||||
86 | spec_version => $schema_info->{specification_version}, | ||||
87 | schema_path => '', | ||||
88 | vocabularies => $schema_info->{vocabularies}, # reference, not copy | ||||
89 | 41707 | 798ms | 83414 | 307ms | }); # spent 307ms making 41707 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call
# spent 1142s making 41707 calls to JSON::Schema::Modern::_eval_subschema, avg 27.4ms/call, recursion: max depth 74, sum of overlapping time 1142s |
90 | } | ||||
91 | |||||
92 | 1 | 7µs | 1; | ||
93 | |||||
94 | 1 | 25µs | 1 | 342µs | __END__ # spent 342µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:26] |
# spent 485µs within JSON::Schema::Modern::Vocabulary::CORE:sort which was called 401 times, avg 1µs/call:
# 401 times (485µs+0s) by JSON::Schema::Modern::Vocabulary::traverse_object_schemas at line 53, avg 1µs/call |