← 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.pm
StatementsExecuted 683026 statements in 1.47s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41707211.18s87.2sJSON::Schema::Modern::Vocabulary::::eval_subschema_at_uriJSON::Schema::Modern::Vocabulary::eval_subschema_at_uri (recurses: max depth 38, inclusive time 966s)
49887121342ms87.2sJSON::Schema::Modern::Vocabulary::::evalJSON::Schema::Modern::Vocabulary::eval (recurses: max depth 34, inclusive time 867s)
4023217.2ms327msJSON::Schema::Modern::Vocabulary::::traverse_object_schemasJSON::Schema::Modern::Vocabulary::traverse_object_schemas (recurses: max depth 3, inclusive time 76.5ms)
5621034.40ms153msJSON::Schema::Modern::Vocabulary::::traverse_subschemaJSON::Schema::Modern::Vocabulary::traverse_subschema (recurses: max depth 2, inclusive time 26.0ms)
76312.19ms48.2msJSON::Schema::Modern::Vocabulary::::traverse_array_schemasJSON::Schema::Modern::Vocabulary::traverse_array_schemas (recurses: max depth 2, inclusive time 1.57ms)
40211417µs417µsJSON::Schema::Modern::Vocabulary::::CORE:sortJSON::Schema::Modern::Vocabulary::CORE:sort (opcode)
61193µs895µsJSON::Schema::Modern::Vocabulary::::traverse_property_schemaJSON::Schema::Modern::Vocabulary::traverse_property_schema
11157µs62µsMoo::_Utils::::BEGIN@1.305 Moo::_Utils::BEGIN@1.305
11136µs50µsJSON::Schema::Modern::Vocabulary::::BEGIN@15JSON::Schema::Modern::Vocabulary::BEGIN@15
11133µs1.02msJSON::Schema::Modern::Vocabulary::::BEGIN@11JSON::Schema::Modern::Vocabulary::BEGIN@11
11128µs28µsJSON::Schema::Modern::Vocabulary::::BEGIN@19JSON::Schema::Modern::Vocabulary::BEGIN@19
11123µs54µsJSON::Schema::Modern::Vocabulary::::BEGIN@13JSON::Schema::Modern::Vocabulary::BEGIN@13
11121µs21µsJSON::Schema::Modern::Vocabulary::::BEGIN@9JSON::Schema::Modern::Vocabulary::BEGIN@9
11118µs42µsJSON::Schema::Modern::Vocabulary::::BEGIN@14JSON::Schema::Modern::Vocabulary::BEGIN@14
11114µs27µsJSON::Schema::Modern::Vocabulary::::BEGIN@16JSON::Schema::Modern::Vocabulary::BEGIN@16
11113µs342µsJSON::Schema::Modern::Vocabulary::::BEGIN@10JSON::Schema::Modern::Vocabulary::BEGIN@10
11112µs157µsJSON::Schema::Modern::Vocabulary::::BEGIN@12JSON::Schema::Modern::Vocabulary::BEGIN@12
11110µs48µsJSON::Schema::Modern::Vocabulary::::BEGIN@17JSON::Schema::Modern::Vocabulary::BEGIN@17
1117µs170µsJSON::Schema::Modern::Vocabulary::::BEGIN@20JSON::Schema::Modern::Vocabulary::BEGIN@20
1117µs41µsMoo::_Utils::::BEGIN@2.306 Moo::_Utils::BEGIN@2.306
1116µs25µsJSON::Schema::Modern::Vocabulary::::BEGIN@18JSON::Schema::Modern::Vocabulary::BEGIN@18
3111µs1µsJSON::Schema::Modern::Vocabulary::::evaluation_orderJSON::Schema::Modern::Vocabulary::evaluation_order
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
1239µs267µs
# spent 62µs (57+5) within Moo::_Utils::BEGIN@1.305 which was called: # once (57µs+5µs) by Moo::_Utils::_require at line 1
use strict;
# spent 62µs making 1 call to Moo::_Utils::BEGIN@1.305 # spent 5µs making 1 call to strict::import
2255µs275µs
# spent 41µs (7+34) within Moo::_Utils::BEGIN@2.306 which was called: # once (7µs+34µs) by Moo::_Utils::_require at line 2
use warnings;
# spent 41µs making 1 call to Moo::_Utils::BEGIN@2.306 # spent 34µ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
710sour $VERSION = '0.558';
8
9241µs121µs
# spent 21µs within JSON::Schema::Modern::Vocabulary::BEGIN@9 which was called: # once (21µs+0s) by Moo::_Utils::_require at line 9
use 5.020;
# spent 21µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@9
102389µs2363µs
# spent 342µs (13+329) within JSON::Schema::Modern::Vocabulary::BEGIN@10 which was called: # once (13µs+329µs) by Moo::_Utils::_require at line 10
use Moo::Role;
# spent 342µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@10 # spent 21µs making 1 call to Moo::Role::import
113129µs32.01ms
# spent 1.02ms (33µs+988µs) within JSON::Schema::Modern::Vocabulary::BEGIN@11 which was called: # once (33µs+988µs) by Moo::_Utils::_require at line 11
use strictures 2;
# spent 1.02ms making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@11 # spent 962µs making 1 call to strictures::import # spent 25µs making 1 call to strictures::VERSION
12254µs2302µs
# spent 157µs (12+145) within JSON::Schema::Modern::Vocabulary::BEGIN@12 which was called: # once (12µs+145µs) by Moo::_Utils::_require at line 12
use experimental qw(signatures postderef);
# spent 157µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@12 # spent 145µs making 1 call to experimental::import
13240µs258µs
# spent 54µs (23+31) within JSON::Schema::Modern::Vocabulary::BEGIN@13 which was called: # once (23µs+31µs) by Moo::_Utils::_require at line 13
use if "$]" >= 5.022, experimental => 're_strict';
# spent 54µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@13 # spent 4µs making 1 call to if::import
14241µs245µs
# spent 42µs (18+24) within JSON::Schema::Modern::Vocabulary::BEGIN@14 which was called: # once (18µs+24µs) by Moo::_Utils::_require at line 14
no if "$]" >= 5.031009, feature => 'indirect';
# spent 42µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@14 # spent 3µs making 1 call to if::unimport
15221µs251µs
# spent 50µs (36+14) within JSON::Schema::Modern::Vocabulary::BEGIN@15 which was called: # once (36µs+14µs) by Moo::_Utils::_require at line 15
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 50µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@15 # spent 1µs making 1 call to if::unimport
16251µs229µs
# spent 27µs (14+13) within JSON::Schema::Modern::Vocabulary::BEGIN@16 which was called: # once (14µs+13µs) by Moo::_Utils::_require at line 16
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 27µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@16 # spent 2µs making 1 call to if::unimport
17336µs386µs
# spent 48µs (10+38) within JSON::Schema::Modern::Vocabulary::BEGIN@17 which was called: # once (10µs+38µs) by Moo::_Utils::_require at line 17
use Ref::Util 0.100 'is_plain_arrayref';
# spent 48µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@17 # spent 29µs making 1 call to Exporter::import # spent 9µs making 1 call to UNIVERSAL::VERSION
18214µs244µs
# spent 25µs (6+19) within JSON::Schema::Modern::Vocabulary::BEGIN@18 which was called: # once (6µs+19µs) by Moo::_Utils::_require at line 18
use JSON::Schema::Modern::Utilities qw(jsonp assert_keyword_type abort);
# spent 25µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@18 # spent 19µs making 1 call to Exporter::import
19245µs128µs
# spent 28µs within JSON::Schema::Modern::Vocabulary::BEGIN@19 which was called: # once (28µs+0s) by Moo::_Utils::_require at line 19
use Carp ();
# spent 28µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@19
202847µs2333µs
# spent 170µs (7+163) within JSON::Schema::Modern::Vocabulary::BEGIN@20 which was called: # once (7µs+163µs) by Moo::_Utils::_require at line 20
use namespace::clean;
# spent 170µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@20 # spent 163µs making 1 call to namespace::clean::import
21
2211µsour @CARP_NOT = qw(JSON::Schema::Modern);
23
2411µs142µsrequires qw(vocabulary keywords);
# spent 42µs making 1 call to Moo::Role::requires
25
2634µs
# spent 1µs within JSON::Schema::Modern::Vocabulary::evaluation_order which was called 3 times, avg 333ns/call: # 3 times (1µs+0s) by JSON::Schema::Modern::Vocabulary::Core::CORE:sort at line 331 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 333ns/call
sub evaluation_order { 999 } # override, if needed
27
28sub traverse ($self, $schema, $state) {
29 $state->{evaluator}->_traverse_subschema($schema, $state);
30}
31
322248337µs
# spent 153ms (4.40+149) within JSON::Schema::Modern::Vocabulary::traverse_subschema which was called 562 times, avg 273µs/call: # 156 times (1.39ms+2.33ms) by JSON::Schema::Modern::Vocabulary::Unevaluated::_traverse_keyword_unevaluatedProperties at line 101 of JSON/Schema/Modern/Vocabulary/Unevaluated.pm, avg 24µs/call # 130 times (960µs+26.0ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties at line 438 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 207µs/call # 98 times (881µs+86.4ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items at line 246 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 891µs/call # 65 times (361µs+16.8ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then at line 139 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 264µs/call # 65 times (430µs+9.67ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if at line 138 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 155µs/call # 15 times (84µs+2.91ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else at line 140 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 200µs/call # 15 times (154µs+926µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_not at line 127 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 72µs/call # 14 times (100µs+3.48ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames at line 473 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 256µs/call # 3 times (24µs+204µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains at line 331 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 76µs/call # once (9µs+63µs) by JSON::Schema::Modern::Vocabulary::Content::_traverse_keyword_contentSchema at line 99 of JSON/Schema/Modern/Vocabulary/Content.pm
sub traverse_subschema ($self, $schema, $state) {
33 $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}},
345624.16ms5620s +{ %$state, schema_path => $state->{schema_path}.'/'.$state->{keyword} });
# spent 175ms making 562 calls to JSON::Schema::Modern::_traverse_subschema, avg 311µs/call, recursion: max depth 6, sum of overlapping time 175ms
35}
36
37304112µs
# spent 48.2ms (2.19+46.1) within JSON::Schema::Modern::Vocabulary::traverse_array_schemas which was called 76 times, avg 635µs/call: # 32 times (831µs+13.4ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf at line 88 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 444µs/call # 23 times (816µs+20.7ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf at line 68 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 934µs/call # 21 times (541µs+12.0ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf at line 105 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 598µs/call
sub traverse_array_schemas ($self, $schema, $state) {
387682µs76460µs return if not assert_keyword_type($state, $schema, 'array');
# spent 460µs making 76 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 6µs/call
397681µs return E($state, '%s array is empty', $state->{keyword}) if not $schema->{$state->{keyword}}->@*;
40
417611µs my $valid = 1;
4276194µs foreach my $idx (0 .. $schema->{$state->{keyword}}->$#*) {
43 $valid = 0 if not $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}[$idx],
442031.40ms2030s +{ %$state, schema_path => $state->{schema_path}.'/'.$state->{keyword}.'/'.$idx });
# spent 47.2ms making 203 calls to JSON::Schema::Modern::_traverse_subschema, avg 232µs/call, recursion: max depth 6, sum of overlapping time 47.2ms
45 }
4676159µs return $valid;
47}
48
491608280µs
# spent 327ms (17.2+310) within JSON::Schema::Modern::Vocabulary::traverse_object_schemas which was called 402 times, avg 813µs/call: # 387 times (16.2ms+241ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties at line 363 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 665µs/call # 12 times (910µs+68.6ms) by JSON::Schema::Modern::Vocabulary::Core::_traverse_keyword_defs at line 292 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 5.79ms/call # 3 times (43µs+-43µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_dependentSchemas at line 158 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call
sub traverse_object_schemas ($self, $schema, $state) {
50402511µs4023.48ms return if not assert_keyword_type($state, $schema, 'object');
# spent 3.48ms making 402 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 9µs/call
51
52402121µs my $valid = 1;
534022.95ms402417µs foreach my $property (sort keys $schema->{$state->{keyword}}->%*) {
# spent 417µs making 402 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},
55134911.2ms269811.2ms +{ %$state, schema_path => jsonp($state->{schema_path}, $state->{keyword}, $property) });
# spent 11.2ms making 1349 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call # spent 371ms making 1349 calls to JSON::Schema::Modern::_traverse_subschema, avg 275µs/call, recursion: max depth 6, sum of overlapping time 371ms
56 }
57402932µs return $valid;
58}
59
60305µs
# spent 895µs (93+802) within JSON::Schema::Modern::Vocabulary::traverse_property_schema which was called 6 times, avg 149µs/call: # 6 times (93µs+802µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties at line 402 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 149µs/call
sub traverse_property_schema ($self, $schema, $state, $property) {
6167µs634µs return if not assert_keyword_type($state, $schema, 'object');
# spent 34µs making 6 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 6µs/call
62
63 $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}{$property},
64642µs1241µs +{ %$state, schema_path => jsonp($state->{schema_path}, $state->{keyword}, $property) });
# spent 41µs making 6 calls to JSON::Schema::Modern::Utilities::jsonp, avg 7µs/call # spent 727µs making 6 calls to JSON::Schema::Modern::_traverse_subschema, avg 121µs/call, recursion: max depth 2, sum of overlapping time 727µs
65}
66
6724943583.0ms
# spent 87.2s (342ms+86.8) within JSON::Schema::Modern::Vocabulary::eval which was called 49887 times, avg 1.75ms/call: # 25750 times (147ms+-147ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf at line 73 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 10912 times (108ms+87.0s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties at line 380 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 7.99ms/call # 3013 times (18.2ms+-18.2ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if at line 148 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 2365 times (13.3ms+-8.84ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_anyOf at line 95 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 2µs/call # 2214 times (10.4ms+-10.4ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if at line 154 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 1835 times (13.6ms+-13.6ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties at line 457 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 1443 times (17.0ms+-17.0ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword__items_schema at line 312 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 738 times (5.47ms+-5.47ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_patternProperties at line 421 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 713 times (4.10ms+-4.10ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames at line 480 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 610 times (2.84ms+-2.84ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_oneOf at line 111 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 290 times (1.26ms+-1.26ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas at line 167 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 4 times (24µs+-24µs) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_not at line 133 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 954s making 49887 calls to JSON::Schema::Modern::_eval_subschema, avg 19.1ms/call, recursion: max depth 73, sum of overlapping time 954s
69}
70
7125024252.9ms
# spent 87.2s (1.18+86.0) within JSON::Schema::Modern::Vocabulary::eval_subschema_at_uri which was called 41707 times, avg 2.09ms/call: # 39121 times (1.11s+86.1s) by JSON::Schema::Modern::Vocabulary::Core::_eval_keyword_ref at line 210 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 2.23ms/call # 2586 times (69.3ms+-69.3ms) by JSON::Schema::Modern::Vocabulary::Core::_eval_keyword_dynamicRef at line 252 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 0s/call
sub eval_subschema_at_uri ($self, $data, $schema, $state, $uri) {
7241707114ms4170721.1s my $schema_info = $state->{evaluator}->_fetch_from_uri($uri);
# spent 21.1s making 41707 calls to JSON::Schema::Modern::_fetch_from_uri, avg 506µs/call
734170712.8ms 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
8941707948ms83414364ms });
# spent 364ms making 41707 calls to JSON::Schema::Modern::Utilities::jsonp, avg 9µs/call # spent 1030s making 41707 calls to JSON::Schema::Modern::_eval_subschema, avg 24.7ms/call, recursion: max depth 74, sum of overlapping time 1030s
90}
91
9215µs1;
93
94121µs1287µs__END__
 
# spent 417µs within JSON::Schema::Modern::Vocabulary::CORE:sort which was called 402 times, avg 1µs/call: # 402 times (417µ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