← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:33:55 2022
Reported on Wed Dec 14 15:40:04 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Vocabulary.pm
StatementsExecuted 683022 statements in 1.27s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41707211.03s97.2sJSON::Schema::Modern::Vocabulary::::eval_subschema_at_uriJSON::Schema::Modern::Vocabulary::eval_subschema_at_uri (recurses: max depth 38, inclusive time 1064s)
49887121288ms97.0sJSON::Schema::Modern::Vocabulary::::evalJSON::Schema::Modern::Vocabulary::eval (recurses: max depth 34, inclusive time 949s)
4013216.3ms367msJSON::Schema::Modern::Vocabulary::::traverse_object_schemasJSON::Schema::Modern::Vocabulary::traverse_object_schemas (recurses: max depth 3, inclusive time 91.8ms)
5611034.37ms165msJSON::Schema::Modern::Vocabulary::::traverse_subschemaJSON::Schema::Modern::Vocabulary::traverse_subschema (recurses: max depth 2, inclusive time 28.0ms)
77312.28ms57.4msJSON::Schema::Modern::Vocabulary::::traverse_array_schemasJSON::Schema::Modern::Vocabulary::traverse_array_schemas (recurses: max depth 2, inclusive time 2.37ms)
40111485µs485µsJSON::Schema::Modern::Vocabulary::::CORE:sortJSON::Schema::Modern::Vocabulary::CORE:sort (opcode)
71174µs1.33msJSON::Schema::Modern::Vocabulary::::traverse_property_schemaJSON::Schema::Modern::Vocabulary::traverse_property_schema
11142µs46µsMoo::_Utils::::BEGIN@1.304 Moo::_Utils::BEGIN@1.304
11119µs770µsJSON::Schema::Modern::Vocabulary::::BEGIN@11JSON::Schema::Modern::Vocabulary::BEGIN@11
11115µs15µsJSON::Schema::Modern::Vocabulary::::BEGIN@9JSON::Schema::Modern::Vocabulary::BEGIN@9
11113µs358µsJSON::Schema::Modern::Vocabulary::::BEGIN@10JSON::Schema::Modern::Vocabulary::BEGIN@10
11112µs32µsJSON::Schema::Modern::Vocabulary::::BEGIN@13JSON::Schema::Modern::Vocabulary::BEGIN@13
11110µs27µsJSON::Schema::Modern::Vocabulary::::BEGIN@14JSON::Schema::Modern::Vocabulary::BEGIN@14
11110µs38µsJSON::Schema::Modern::Vocabulary::::BEGIN@17JSON::Schema::Modern::Vocabulary::BEGIN@17
1119µs46µsMoo::_Utils::::BEGIN@2.305 Moo::_Utils::BEGIN@2.305
1117µs95µsJSON::Schema::Modern::Vocabulary::::BEGIN@12JSON::Schema::Modern::Vocabulary::BEGIN@12
1117µs13µsJSON::Schema::Modern::Vocabulary::::BEGIN@16JSON::Schema::Modern::Vocabulary::BEGIN@16
1116µs17µsJSON::Schema::Modern::Vocabulary::::BEGIN@15JSON::Schema::Modern::Vocabulary::BEGIN@15
1116µs27µsJSON::Schema::Modern::Vocabulary::::BEGIN@18JSON::Schema::Modern::Vocabulary::BEGIN@18
1116µs195µsJSON::Schema::Modern::Vocabulary::::BEGIN@20JSON::Schema::Modern::Vocabulary::BEGIN@20
3112µs2µsJSON::Schema::Modern::Vocabulary::::evaluation_orderJSON::Schema::Modern::Vocabulary::evaluation_order
1111µs1µsJSON::Schema::Modern::Vocabulary::::BEGIN@19JSON::Schema::Modern::Vocabulary::BEGIN@19
0000s0sJSON::Schema::Modern::Vocabulary::::traverseJSON::Schema::Modern::Vocabulary::traverse
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1250µs250µ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
use strict;
# spent 46µs making 1 call to Moo::_Utils::BEGIN@1.304 # spent 4µs making 1 call to strict::import
2256µs283µ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
use warnings;
# spent 46µs making 1 call to Moo::_Utils::BEGIN@2.305 # spent 37µs making 1 call to warnings::import
3package 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
711µsour $VERSION = '0.552';
8
9240µs115µ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
use 5.020;
# spent 15µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@9
10231µs2379µ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
use Moo::Role;
# spent 358µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@10 # spent 21µs making 1 call to Moo::Role::import
11334µs31.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
use strictures 2;
# 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
12233µs2183µ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
use experimental qw(signatures postderef);
# spent 95µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@12 # spent 88µs making 1 call to experimental::import
13231µs233µ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
use if "$]" >= 5.022, experimental => 're_strict';
# spent 32µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@13 # spent 1µs making 1 call to if::import
14220µs229µ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
no if "$]" >= 5.031009, feature => 'indirect';
# spent 27µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@14 # spent 2µs making 1 call to if::unimport
15218µs218µ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
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 17µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@15 # spent 1µs making 1 call to if::unimport
16216µs213µ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
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 13µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@16 # spent 0s making 1 call to if::unimport
17334µs366µ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
use Ref::Util 0.100 'is_plain_arrayref';
# 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
18214µs248µ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
use JSON::Schema::Modern::Utilities qw(jsonp assert_keyword_type abort);
# spent 27µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@18 # spent 21µs making 1 call to Exporter::import
19211µs11µ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
use Carp ();
# spent 1µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@19
202746µs2384µ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
use namespace::clean;
# spent 195µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@20 # spent 189µs making 1 call to namespace::clean::import
21
2211µsour @CARP_NOT = qw(JSON::Schema::Modern);
23
2411µs19µsrequires qw(vocabulary keywords);
# spent 9µs making 1 call to Moo::Role::requires
25
2634µ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
sub evaluation_order { 999 } # override, if needed
27
28sub traverse ($self, $schema, $state) {
29 $state->{evaluator}->_traverse_subschema($schema, $state);
30}
31
322244355µ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
sub traverse_subschema ($self, $schema, $state) {
33 $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}},
345614.09ms5610s +{ %$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
3730873µ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
sub traverse_array_schemas ($self, $schema, $state) {
3877107µs77675µ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
397783µs return E($state, '%s array is empty', $state->{keyword}) if not $schema->{$state->{keyword}}->@*;
40
417725µs my $valid = 1;
4277227µs foreach my $idx (0 .. $schema->{$state->{keyword}}->$#*) {
43 $valid = 0 if not $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}[$idx],
442051.52ms2050s +{ %$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 }
4677245µs return $valid;
47}
48
491604255µ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
sub traverse_object_schemas ($self, $schema, $state) {
50401637µs4013.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
52401151µs my $valid = 1;
534013.02ms401485µ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},
55134010.5ms268011.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 }
57401868µs return $valid;
58}
59
60354µ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
sub traverse_property_schema ($self, $schema, $state, $property) {
61714µs735µ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},
64750µs1458µ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
6724943565.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
sub eval ($self, $data, $schema, $state) {
6849887235ms498870s $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
7125024245.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
sub eval_subschema_at_uri ($self, $data, $schema, $state, $uri) {
724170793.1ms4170718.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
734170711.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
8941707798ms83414307ms });
# 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
9217µs1;
93
94125µs1342µs__END__
 
# 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
sub JSON::Schema::Modern::Vocabulary::CORE:sort; # opcode