← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:57:08 2022
Reported on Wed Dec 14 16:00:37 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Vocabulary.pm
StatementsExecuted 683026 statements in 1.40s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41707211.15s99.6sJSON::Schema::Modern::Vocabulary::::eval_subschema_at_uriJSON::Schema::Modern::Vocabulary::eval_subschema_at_uri (recurses: max depth 38, inclusive time 1120s)
49887121294ms99.4sJSON::Schema::Modern::Vocabulary::::evalJSON::Schema::Modern::Vocabulary::eval (recurses: max depth 34, inclusive time 997s)
4023224.5ms389msJSON::Schema::Modern::Vocabulary::::traverse_object_schemasJSON::Schema::Modern::Vocabulary::traverse_object_schemas (recurses: max depth 3, inclusive time 97.3ms)
5621035.70ms179msJSON::Schema::Modern::Vocabulary::::traverse_subschemaJSON::Schema::Modern::Vocabulary::traverse_subschema (recurses: max depth 2, inclusive time 29.7ms)
76312.66ms57.3msJSON::Schema::Modern::Vocabulary::::traverse_array_schemasJSON::Schema::Modern::Vocabulary::traverse_array_schemas (recurses: max depth 2, inclusive time 2.51ms)
40211579µs579µsJSON::Schema::Modern::Vocabulary::::CORE:sortJSON::Schema::Modern::Vocabulary::CORE:sort (opcode)
61179µs1.49msJSON::Schema::Modern::Vocabulary::::traverse_property_schemaJSON::Schema::Modern::Vocabulary::traverse_property_schema
11160µs64µsMoo::_Utils::::BEGIN@1.304 Moo::_Utils::BEGIN@1.304
11139µs646µsJSON::Schema::Modern::Vocabulary::::BEGIN@11JSON::Schema::Modern::Vocabulary::BEGIN@11
11119µs46µsJSON::Schema::Modern::Vocabulary::::BEGIN@13JSON::Schema::Modern::Vocabulary::BEGIN@13
11117µs38µsJSON::Schema::Modern::Vocabulary::::BEGIN@14JSON::Schema::Modern::Vocabulary::BEGIN@14
11114µs28µsJSON::Schema::Modern::Vocabulary::::BEGIN@15JSON::Schema::Modern::Vocabulary::BEGIN@15
11114µs61µsJSON::Schema::Modern::Vocabulary::::BEGIN@17JSON::Schema::Modern::Vocabulary::BEGIN@17
11111µs456µsJSON::Schema::Modern::Vocabulary::::BEGIN@10JSON::Schema::Modern::Vocabulary::BEGIN@10
11111µs11µsJSON::Schema::Modern::Vocabulary::::BEGIN@9JSON::Schema::Modern::Vocabulary::BEGIN@9
11110µs52µsJSON::Schema::Modern::Vocabulary::::BEGIN@18JSON::Schema::Modern::Vocabulary::BEGIN@18
1119µs19µsJSON::Schema::Modern::Vocabulary::::BEGIN@16JSON::Schema::Modern::Vocabulary::BEGIN@16
1118µs319µsJSON::Schema::Modern::Vocabulary::::BEGIN@20JSON::Schema::Modern::Vocabulary::BEGIN@20
1117µs118µsJSON::Schema::Modern::Vocabulary::::BEGIN@12JSON::Schema::Modern::Vocabulary::BEGIN@12
1116µs33µsMoo::_Utils::::BEGIN@2.305 Moo::_Utils::BEGIN@2.305
1112µs2µsJSON::Schema::Modern::Vocabulary::::BEGIN@19JSON::Schema::Modern::Vocabulary::BEGIN@19
3112µs2µ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
12198µs268µs
# spent 64µs (60+4) within Moo::_Utils::BEGIN@1.304 which was called: # once (60µs+4µs) by Moo::_Utils::_require at line 1
use strict;
# spent 64µs making 1 call to Moo::_Utils::BEGIN@1.304 # spent 4µs making 1 call to strict::import
2274µs260µs
# spent 33µs (6+27) within Moo::_Utils::BEGIN@2.305 which was called: # once (6µs+27µs) by Moo::_Utils::_require at line 2
use warnings;
# spent 33µs making 1 call to Moo::_Utils::BEGIN@2.305 # spent 27µ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.556';
8
9233µs111µs
# spent 11µs within JSON::Schema::Modern::Vocabulary::BEGIN@9 which was called: # once (11µs+0s) by Moo::_Utils::_require at line 9
use 5.020;
# spent 11µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@9
10228µs2477µs
# spent 456µs (11+445) within JSON::Schema::Modern::Vocabulary::BEGIN@10 which was called: # once (11µs+445µs) by Moo::_Utils::_require at line 10
use Moo::Role;
# spent 456µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@10 # spent 21µs making 1 call to Moo::Role::import
11364µs31.25ms
# spent 646µs (39+607) within JSON::Schema::Modern::Vocabulary::BEGIN@11 which was called: # once (39µs+607µs) by Moo::_Utils::_require at line 11
use strictures 2;
# spent 646µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@11 # spent 592µs making 1 call to strictures::import # spent 14µs making 1 call to strictures::VERSION
12244µs2229µs
# spent 118µs (7+111) within JSON::Schema::Modern::Vocabulary::BEGIN@12 which was called: # once (7µs+111µs) by Moo::_Utils::_require at line 12
use experimental qw(signatures postderef);
# spent 118µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@12 # spent 111µs making 1 call to experimental::import
13233µs250µs
# spent 46µs (19+27) within JSON::Schema::Modern::Vocabulary::BEGIN@13 which was called: # once (19µs+27µs) by Moo::_Utils::_require at line 13
use if "$]" >= 5.022, experimental => 're_strict';
# spent 46µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@13 # spent 4µs making 1 call to if::import
14230µs239µs
# spent 38µs (17+21) within JSON::Schema::Modern::Vocabulary::BEGIN@14 which was called: # once (17µs+21µs) by Moo::_Utils::_require at line 14
no if "$]" >= 5.031009, feature => 'indirect';
# spent 38µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@14 # spent 1µs making 1 call to if::unimport
15230µs229µs
# spent 28µs (14+14) within JSON::Schema::Modern::Vocabulary::BEGIN@15 which was called: # once (14µs+14µs) by Moo::_Utils::_require at line 15
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 28µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@15 # spent 1µs making 1 call to if::unimport
16222µs221µs
# spent 19µs (9+10) within JSON::Schema::Modern::Vocabulary::BEGIN@16 which was called: # once (9µs+10µs) by Moo::_Utils::_require at line 16
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 19µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@16 # spent 2µs making 1 call to if::unimport
17351µs3108µs
# spent 61µs (14+47) within JSON::Schema::Modern::Vocabulary::BEGIN@17 which was called: # once (14µs+47µs) by Moo::_Utils::_require at line 17
use Ref::Util 0.100 'is_plain_arrayref';
# spent 61µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@17 # spent 37µs making 1 call to Exporter::import # spent 10µs making 1 call to UNIVERSAL::VERSION
18226µs294µs
# spent 52µs (10+42) within JSON::Schema::Modern::Vocabulary::BEGIN@18 which was called: # once (10µs+42µs) by Moo::_Utils::_require at line 18
use JSON::Schema::Modern::Utilities qw(jsonp assert_keyword_type abort);
# spent 52µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@18 # spent 42µs making 1 call to Exporter::import
19219µs12µs
# spent 2µs within JSON::Schema::Modern::Vocabulary::BEGIN@19 which was called: # once (2µs+0s) by Moo::_Utils::_require at line 19
use Carp ();
# spent 2µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@19
202607µs2630µs
# spent 319µs (8+311) within JSON::Schema::Modern::Vocabulary::BEGIN@20 which was called: # once (8µs+311µs) by Moo::_Utils::_require at line 20
use namespace::clean;
# spent 319µs making 1 call to JSON::Schema::Modern::Vocabulary::BEGIN@20 # spent 311µs making 1 call to namespace::clean::import
21
2211µsour @CARP_NOT = qw(JSON::Schema::Modern);
23
2412µs111µsrequires qw(vocabulary keywords);
# spent 11µs making 1 call to Moo::Role::requires
25
2636µ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 331 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
322248440µs
# spent 179ms (5.70+173) within JSON::Schema::Modern::Vocabulary::traverse_subschema which was called 562 times, avg 318µs/call: # 156 times (1.90ms+2.60ms) by JSON::Schema::Modern::Vocabulary::Unevaluated::_traverse_keyword_unevaluatedProperties at line 101 of JSON/Schema/Modern/Vocabulary/Unevaluated.pm, avg 29µs/call # 130 times (1.26ms+30.4ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_additionalProperties at line 438 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 243µs/call # 98 times (1.02ms+100ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_items at line 246 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 1.04ms/call # 65 times (467µs+17.7ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_then at line 139 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 280µs/call # 65 times (554µs+10.6ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_if at line 138 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 172µs/call # 15 times (186µs+5.08ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_else at line 140 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 351µs/call # 15 times (116µs+959µ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 (171µs+4.84ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_propertyNames at line 473 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 358µs/call # 3 times (26µs+173µs) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_contains at line 331 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 66µs/call # once (7µs+65µ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}},
345625.32ms5620s +{ %$state, schema_path => $state->{schema_path}.'/'.$state->{keyword} });
# spent 203ms making 562 calls to JSON::Schema::Modern::_traverse_subschema, avg 361µs/call, recursion: max depth 6, sum of overlapping time 203ms
35}
36
3730478µs
# spent 57.3ms (2.66+54.6) within JSON::Schema::Modern::Vocabulary::traverse_array_schemas which was called 76 times, avg 754µs/call: # 32 times (958µs+12.7ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_anyOf at line 88 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 428µs/call # 23 times (1.10ms+24.0ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_allOf at line 68 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 1.09ms/call # 21 times (599µs+18.0ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_oneOf at line 105 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 883µs/call
sub traverse_array_schemas ($self, $schema, $state) {
3876119µs76493µs return if not assert_keyword_type($state, $schema, 'array');
# spent 493µs making 76 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 6µs/call
397687µs return E($state, '%s array is empty', $state->{keyword}) if not $schema->{$state->{keyword}}->@*;
40
417616µs my $valid = 1;
4276157µs foreach my $idx (0 .. $schema->{$state->{keyword}}->$#*) {
43 $valid = 0 if not $state->{evaluator}->_traverse_subschema($schema->{$state->{keyword}}[$idx],
442031.60ms2030s +{ %$state, schema_path => $state->{schema_path}.'/'.$state->{keyword}.'/'.$idx });
# spent 56.7ms making 203 calls to JSON::Schema::Modern::_traverse_subschema, avg 279µs/call, recursion: max depth 6, sum of overlapping time 56.7ms
45 }
4676215µs return $valid;
47}
48
491608515µs
# spent 389ms (24.5+365) within JSON::Schema::Modern::Vocabulary::traverse_object_schemas which was called 402 times, avg 968µs/call: # 387 times (23.5ms+275ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_properties at line 363 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 772µs/call # 12 times (931µs+89.4ms) by JSON::Schema::Modern::Vocabulary::Core::_traverse_keyword_defs at line 292 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 7.53ms/call # 3 times (46µs+-46µ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) {
50402974µs4024.21ms return if not assert_keyword_type($state, $schema, 'object');
# spent 4.21ms making 402 calls to JSON::Schema::Modern::Utilities::assert_keyword_type, avg 10µs/call
51
52402114µs my $valid = 1;
534023.31ms402579µs foreach my $property (sort keys $schema->{$state->{keyword}}->%*) {
# spent 579µ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},
55134915.3ms269815.7ms +{ %$state, schema_path => jsonp($state->{schema_path}, $state->{keyword}, $property) });
# spent 15.7ms making 1349 calls to JSON::Schema::Modern::Utilities::jsonp, avg 12µs/call # spent 441ms making 1349 calls to JSON::Schema::Modern::_traverse_subschema, avg 327µs/call, recursion: max depth 6, sum of overlapping time 441ms
56 }
574021.23ms return $valid;
58}
59
60306µs
# spent 1.49ms (79µs+1.41) within JSON::Schema::Modern::Vocabulary::traverse_property_schema which was called 6 times, avg 248µs/call: # 6 times (79µs+1.41ms) by JSON::Schema::Modern::Vocabulary::Applicator::_traverse_keyword_patternProperties at line 402 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 248µs/call
sub traverse_property_schema ($self, $schema, $state, $property) {
6169µs635µs return if not assert_keyword_type($state, $schema, 'object');
# spent 35µ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},
64652µs1256µs +{ %$state, schema_path => jsonp($state->{schema_path}, $state->{keyword}, $property) });
# spent 56µs making 6 calls to JSON::Schema::Modern::Utilities::jsonp, avg 9µs/call # spent 1.32ms making 6 calls to JSON::Schema::Modern::_traverse_subschema, avg 220µs/call, recursion: max depth 2, sum of overlapping time 1.32ms
65}
66
6724943562.7ms
# spent 99.4s (294ms+99.1) within JSON::Schema::Modern::Vocabulary::eval which was called 49887 times, avg 1.99ms/call: # 25750 times (142ms+-142ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_allOf at line 73 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 10912 times (76.9ms+99.3s) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_properties at line 380 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 9.11ms/call # 3013 times (16.4ms+-16.4ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if at line 148 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 2365 times (12.4ms+-7.79ms) 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.1ms+-10.1ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_if at line 154 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 1835 times (11.9ms+-11.9ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_additionalProperties at line 457 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 1443 times (9.41ms+-9.41ms) 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.89ms+-5.89ms) 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.22ms+-4.22ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_propertyNames at line 480 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 610 times (3.23ms+-3.23ms) 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.44ms+-1.44ms) by JSON::Schema::Modern::Vocabulary::Applicator::_eval_keyword_dependentSchemas at line 167 of JSON/Schema/Modern/Vocabulary/Applicator.pm, avg 0s/call # 4 times (23µs+-23µ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) {
6849887252ms498870s $state->{evaluator}->_eval_subschema($data, $schema, $state);
# spent 1096s making 49887 calls to JSON::Schema::Modern::_eval_subschema, avg 22.0ms/call, recursion: max depth 73, sum of overlapping time 1096s
69}
70
7125024253.1ms
# spent 99.6s (1.15+98.4) within JSON::Schema::Modern::Vocabulary::eval_subschema_at_uri which was called 41707 times, avg 2.39ms/call: # 39121 times (1.08s+98.5s) by JSON::Schema::Modern::Vocabulary::Core::_eval_keyword_ref at line 210 of JSON/Schema/Modern/Vocabulary/Core.pm, avg 2.55ms/call # 2586 times (70.5ms+-70.5ms) 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) {
7241707104ms4170720.2s my $schema_info = $state->{evaluator}->_fetch_from_uri($uri);
# spent 20.2s making 41707 calls to JSON::Schema::Modern::_fetch_from_uri, avg 485µs/call
734170713.6ms 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
8941707888ms83414329ms });
# spent 329ms making 41707 calls to JSON::Schema::Modern::Utilities::jsonp, avg 8µs/call # spent 1198s making 41707 calls to JSON::Schema::Modern::_eval_subschema, avg 28.7ms/call, recursion: max depth 74, sum of overlapping time 1198s
90}
91
9217µs1;
93
94128µs1299µs__END__
 
# spent 579µs within JSON::Schema::Modern::Vocabulary::CORE:sort which was called 402 times, avg 1µs/call: # 402 times (579µ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