← 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:57 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm
StatementsExecuted 4257 statements in 22.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
212343441388ms388msJSON::Schema::Modern::::CORE:match JSON::Schema::Modern::CORE:match (opcode)
8731111124ms124msJSON::Schema::Modern::::CORE:qr JSON::Schema::Modern::CORE:qr (opcode)
8731111117ms117msJSON::Schema::Modern::::CORE:regcomp JSON::Schema::Modern::CORE:regcomp (opcode)
12893741104ms104msJSON::Schema::Modern::::CORE:sort JSON::Schema::Modern::CORE:sort (opcode)
42171122.2ms90.1msJSON::Schema::Modern::Error::::__ANON__[:39]JSON::Schema::Modern::Error::__ANON__[:39]
1119.82ms13.3msJSON::Schema::Modern::Error::::BEGIN@18JSON::Schema::Modern::Error::BEGIN@18
1111.60ms14.1msJSON::Schema::Modern::Error::::BEGIN@21JSON::Schema::Modern::Error::BEGIN@21
262150µs50µsJSON::Schema::Modern::::CACHED_METASCHEMAS JSON::Schema::Modern::CACHED_METASCHEMAS (xsub)
1263133µs33µsJSON::Schema::Modern::::CORE:subst JSON::Schema::Modern::CORE:subst (opcode)
11129µs1.45msJSON::Schema::Modern::Error::::BEGIN@11JSON::Schema::Modern::Error::BEGIN@11
11128µs31µsJSON::Schema::Modern::::BEGIN@1.66 JSON::Schema::Modern::BEGIN@1.66
11122µs63µsJSON::Schema::Modern::Error::::BEGIN@13JSON::Schema::Modern::Error::BEGIN@13
151122µs22µsJSON::Schema::Modern::::METASCHEMA_URIS JSON::Schema::Modern::METASCHEMA_URIS (xsub)
11118µs18µsJSON::Schema::Modern::Error::::BEGIN@9JSON::Schema::Modern::Error::BEGIN@9
11117µs43µsJSON::Schema::Modern::Error::::BEGIN@14JSON::Schema::Modern::Error::BEGIN@14
11114µs910µsJSON::Schema::Modern::Error::::BEGIN@19JSON::Schema::Modern::Error::BEGIN@19
11113µs30µsJSON::Schema::Modern::Error::::BEGIN@15JSON::Schema::Modern::Error::BEGIN@15
11113µs30µsJSON::Schema::Modern::Error::::BEGIN@16JSON::Schema::Modern::Error::BEGIN@16
11112µs186µsJSON::Schema::Modern::Error::::BEGIN@12JSON::Schema::Modern::Error::BEGIN@12
11110µs814µsJSON::Schema::Modern::Error::::BEGIN@20JSON::Schema::Modern::Error::BEGIN@20
1119µs153µsJSON::Schema::Modern::Error::::BEGIN@17JSON::Schema::Modern::Error::BEGIN@17
1119µs33µsJSON::Schema::Modern::Error::::BEGIN@24JSON::Schema::Modern::Error::BEGIN@24
1118µs40µsJSON::Schema::Modern::::BEGIN@2.67 JSON::Schema::Modern::BEGIN@2.67
1117µs386µsJSON::Schema::Modern::Error::::BEGIN@10JSON::Schema::Modern::Error::BEGIN@10
2211µs1µsJSON::Schema::Modern::::__ANON__ JSON::Schema::Modern::__ANON__ (xsub)
0000s0sJSON::Schema::Modern::Error::::TO_JSONJSON::Schema::Modern::Error::TO_JSON
0000s0sJSON::Schema::Modern::Error::::__ANON__[:24]JSON::Schema::Modern::Error::__ANON__[:24]
0000s0sJSON::Schema::Modern::Error::::__ANON__[:51]JSON::Schema::Modern::Error::__ANON__[:51]
0000s0sJSON::Schema::Modern::Error::::dumpJSON::Schema::Modern::Error::dump
0000s0sJSON::Schema::Modern::Error::::stringifyJSON::Schema::Modern::Error::stringify
1110s0sJSON::Schema::Modern::::SPECIFICATION_VERSION_DEFAULT JSON::Schema::Modern::SPECIFICATION_VERSION_DEFAULT (xsub)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1230µs234µs
# spent 31µs (28+3) within JSON::Schema::Modern::BEGIN@1.66 which was called: # once (28µs+3µs) by JSON::Schema::Modern::BEGIN@33 at line 1
use strict;
# spent 31µs making 1 call to JSON::Schema::Modern::BEGIN@1.66 # spent 3µs making 1 call to strict::import
2254µs272µs
# spent 40µs (8+32) within JSON::Schema::Modern::BEGIN@2.67 which was called: # once (8µs+32µs) by JSON::Schema::Modern::BEGIN@33 at line 2
use warnings;
# spent 40µs making 1 call to JSON::Schema::Modern::BEGIN@2.67 # spent 32µs making 1 call to warnings::import
3package JSON::Schema::Modern::Error;
4# vim: set ts=8 sts=2 sw=2 tw=100 et :
5# ABSTRACT: Contains a single error from a JSON Schema evaluation
6
710sour $VERSION = '0.558';
8
9247µs118µs
# spent 18µs within JSON::Schema::Modern::Error::BEGIN@9 which was called: # once (18µs+0s) by JSON::Schema::Modern::BEGIN@33 at line 9
use 5.020;
# spent 18µs making 1 call to JSON::Schema::Modern::Error::BEGIN@9
10246µs2765µs
# spent 386µs (7+379) within JSON::Schema::Modern::Error::BEGIN@10 which was called: # once (7µs+379µs) by JSON::Schema::Modern::BEGIN@33 at line 10
use Moo;
# spent 386µs making 1 call to JSON::Schema::Modern::Error::BEGIN@10 # spent 379µs making 1 call to Moo::import
11396µs32.88ms
# spent 1.45ms (29µs+1.42) within JSON::Schema::Modern::Error::BEGIN@11 which was called: # once (29µs+1.42ms) by JSON::Schema::Modern::BEGIN@33 at line 11
use strictures 2;
# spent 1.45ms making 1 call to JSON::Schema::Modern::Error::BEGIN@11 # spent 1.38ms making 1 call to strictures::import # spent 44µs making 1 call to strictures::VERSION
12275µs2360µs
# spent 186µs (12+174) within JSON::Schema::Modern::Error::BEGIN@12 which was called: # once (12µs+174µs) by JSON::Schema::Modern::BEGIN@33 at line 12
use experimental qw(signatures postderef);
# spent 186µs making 1 call to JSON::Schema::Modern::Error::BEGIN@12 # spent 174µs making 1 call to experimental::import
13248µs267µs
# spent 63µs (22+41) within JSON::Schema::Modern::Error::BEGIN@13 which was called: # once (22µs+41µs) by JSON::Schema::Modern::BEGIN@33 at line 13
use if "$]" >= 5.022, experimental => 're_strict';
# spent 63µs making 1 call to JSON::Schema::Modern::Error::BEGIN@13 # spent 4µs making 1 call to if::import
14244µs245µs
# spent 43µs (17+26) within JSON::Schema::Modern::Error::BEGIN@14 which was called: # once (17µs+26µs) by JSON::Schema::Modern::BEGIN@33 at line 14
no if "$]" >= 5.031009, feature => 'indirect';
# spent 43µs making 1 call to JSON::Schema::Modern::Error::BEGIN@14 # spent 2µs making 1 call to if::unimport
15248µs231µs
# spent 30µs (13+17) within JSON::Schema::Modern::Error::BEGIN@15 which was called: # once (13µs+17µs) by JSON::Schema::Modern::BEGIN@33 at line 15
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 30µs making 1 call to JSON::Schema::Modern::Error::BEGIN@15 # spent 1µs making 1 call to if::unimport
16223µs230µs
# spent 30µs (13+17) within JSON::Schema::Modern::Error::BEGIN@16 which was called: # once (13µs+17µs) by JSON::Schema::Modern::BEGIN@33 at line 16
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 30µs making 1 call to JSON::Schema::Modern::Error::BEGIN@16 # spent 0s making 1 call to if::unimport
17228µs2297µs
# spent 153µs (9+144) within JSON::Schema::Modern::Error::BEGIN@17 which was called: # once (9µs+144µs) by JSON::Schema::Modern::BEGIN@33 at line 17
use Safe::Isa;
# spent 153µs making 1 call to JSON::Schema::Modern::Error::BEGIN@17 # spent 144µs making 1 call to Exporter::import
182332µs113.3ms
# spent 13.3ms (9.82+3.48) within JSON::Schema::Modern::Error::BEGIN@18 which was called: # once (9.82ms+3.48ms) by JSON::Schema::Modern::BEGIN@33 at line 18
use JSON::PP ();
# spent 13.3ms making 1 call to JSON::Schema::Modern::Error::BEGIN@18
19240µs21.81ms
# spent 910µs (14+896) within JSON::Schema::Modern::Error::BEGIN@19 which was called: # once (14µs+896µs) by JSON::Schema::Modern::BEGIN@33 at line 19
use MooX::TypeTiny;
# spent 910µs making 1 call to JSON::Schema::Modern::Error::BEGIN@19 # spent 896µs making 1 call to MooX::TypeTiny::import
202112µs21.62ms
# spent 814µs (10+804) within JSON::Schema::Modern::Error::BEGIN@20 which was called: # once (10µs+804µs) by JSON::Schema::Modern::BEGIN@33 at line 20
use Types::Standard qw(Str Undef InstanceOf Enum);
# spent 814µs making 1 call to JSON::Schema::Modern::Error::BEGIN@20 # spent 804µs making 1 call to Exporter::Tiny::import
212686µs214.4ms
# spent 14.1ms (1.60+12.5) within JSON::Schema::Modern::Error::BEGIN@21 which was called: # once (1.60ms+12.5ms) by JSON::Schema::Modern::BEGIN@33 at line 21
use namespace::clean;
# spent 14.1ms making 1 call to JSON::Schema::Modern::Error::BEGIN@21 # spent 245µs making 1 call to namespace::clean::import
22
23use overload
242386µs257µs
# spent 33µs (9+24) within JSON::Schema::Modern::Error::BEGIN@24 which was called: # once (9µs+24µs) by JSON::Schema::Modern::BEGIN@33 at line 24
'""' => sub { $_[0]->stringify };
# spent 33µs making 1 call to JSON::Schema::Modern::Error::BEGIN@24 # spent 24µs making 1 call to overload::import
25
2614µs224.9mshas [qw(
# spent 24.9ms making 1 call to JSON::Schema::Modern::Error::has # spent 2µs making 1 call to Types::Standard::Str
27 instance_location
28 keyword_location
29 error
30)] => (
31 is => 'ro',
32 isa => Str,
33 required => 1,
34);
35
36has absolute_keyword_location => (
37 is => 'ro',
38 isa => InstanceOf['Mojo::URL'],
39421720.6ms421767.9ms
# spent 90.1ms (22.2+67.9) within JSON::Schema::Modern::Error::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm:39] which was called 4217 times, avg 21µs/call: # 4217 times (22.2ms+67.9ms) by JSON::Schema::Modern::Error::new at line 68 of (eval 435)[Sub/Quote.pm:3], avg 21µs/call
coerce => sub { $_[0]->$_isa('Mojo::URL') ? $_[0] : Mojo::URL->new($_[0]) },
# spent 67.9ms making 4217 calls to Safe::Isa::__ANON__[Safe/Isa.pm:23], avg 16µs/call
4019µs24.13ms);
# spent 3.46ms making 1 call to Types::Standard::InstanceOf # spent 672µs making 1 call to JSON::Schema::Modern::Error::has
41
42111µs43.36mshas keyword => (
# spent 2.68ms making 1 call to Type::Tiny::__ANON__[Type/Tiny.pm:126] # spent 673µs making 1 call to JSON::Schema::Modern::Error::has # spent 2µs making 1 call to Types::Standard::Str # spent 1µs making 1 call to Types::Standard::Undef
43 is => 'ro',
44 isa => Str|Undef,
45 required => 1,
46);
47
48has exception => (
49 is => 'ro',
50 isa => InstanceOf['JSON::PP::Boolean'],
51 coerce => sub { $_[0] ? JSON::PP::true : JSON::PP::false },
5218µs21.01ms);
# spent 565µs making 1 call to JSON::Schema::Modern::Error::has # spent 440µs making 1 call to Types::Standard::InstanceOf
53
5416µs24.44mshas mode => (
# spent 3.33ms making 1 call to Types::Standard::Enum # spent 1.11ms making 1 call to JSON::Schema::Modern::Error::has
55 is => 'rw',
56 isa => Enum[qw(traverse evaluate)],
57);
58
59sub TO_JSON ($self) {
60 return +{
61 # note that locations are JSON pointers, not uri fragments!
62 instanceLocation => $self->instance_location,
63 keywordLocation => $self->keyword_location,
64 !defined($self->absolute_keyword_location) ? ()
65 : ( absoluteKeywordLocation => $self->absolute_keyword_location->to_string ),
66 error => $self->error, # TODO: allow localization
67 };
68}
69
70sub stringify ($self) {
71 ($self->mode//'evaluate') eq 'traverse'
72 ? '\''.$self->keyword_location.'\': '.$self->error
73 : '\''.$self->instance_location.'\': '.$self->error;
74}
75
76sub dump ($self) {
77 my $encoder = JSON::MaybeXS->new(utf8 => 0, convert_blessed => 1, canonical => 1, pretty => 1);
78 $encoder->indent_length(2) if $encoder->can('indent_length');
79 $encoder->encode($self);
80}
81
82117µs1;
83
84133µs1485µs__END__
 
# spent 50µs within JSON::Schema::Modern::CACHED_METASCHEMAS which was called 26 times, avg 2µs/call: # 18 times (8µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:676] at line 652 of JSON/Schema/Modern.pm, avg 444ns/call # 8 times (42µs+0s) by JSON::Schema::Modern::_get_or_load_resource at line 814 of JSON/Schema/Modern.pm, avg 5µs/call
sub JSON::Schema::Modern::CACHED_METASCHEMAS; # xsub
# spent 388ms within JSON::Schema::Modern::CORE:match which was called 2123434 times, avg 183ns/call: # 2015087 times (263ms+0s) by JSON::Schema::Modern::_eval_subschema at line 529 of JSON/Schema/Modern.pm, avg 130ns/call # 87311 times (107ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 1µs/call # 21018 times (18.3ms+0s) by JSON::Schema::Modern::_fetch_from_uri at line 855 of JSON/Schema/Modern.pm, avg 870ns/call # 18 times (7µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:676] at line 672 of JSON/Schema/Modern.pm, avg 389ns/call
sub JSON::Schema::Modern::CORE:match; # opcode
# spent 124ms within JSON::Schema::Modern::CORE:qr which was called 87311 times, avg 1µs/call: # 87311 times (124ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 1µs/call
sub JSON::Schema::Modern::CORE:qr; # opcode
# spent 117ms within JSON::Schema::Modern::CORE:regcomp which was called 87311 times, avg 1µs/call: # 87311 times (117ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 1µs/call
sub JSON::Schema::Modern::CORE:regcomp; # opcode
# spent 104ms within JSON::Schema::Modern::CORE:sort which was called 128937 times, avg 810ns/call: # 87311 times (22.2ms+0s) by JSON::Schema::Modern::_eval_subschema at line 607 of JSON/Schema/Modern.pm, avg 254ns/call # 39123 times (79.0ms+0s) by JSON::Schema::Modern::_fetch_from_uri at line 865 of JSON/Schema/Modern.pm, avg 2µs/call # 2488 times (3.25ms+0s) by JSON::Schema::Modern::_traverse_subschema at line 507 of JSON/Schema/Modern.pm, avg 1µs/call # 15 times (32µs+0s) by JSON::Schema::Modern::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern.pm:676] at line 647 of JSON/Schema/Modern.pm, avg 2µs/call
sub JSON::Schema::Modern::CORE:sort; # opcode
# spent 33µs within JSON::Schema::Modern::CORE:subst which was called 126 times, avg 262ns/call: # 61 times (16µs+0s) by JSON::Schema::Modern::_traverse_subschema at line 475 of JSON/Schema/Modern.pm, avg 262ns/call # 58 times (12µs+0s) by JSON::Schema::Modern::_eval_subschema at line 563 of JSON/Schema/Modern.pm, avg 207ns/call # 7 times (5µs+0s) by JSON::Schema::Modern::evaluate at line 365 of JSON/Schema/Modern.pm, avg 714ns/call
sub JSON::Schema::Modern::CORE:subst; # opcode
# spent 22µs within JSON::Schema::Modern::METASCHEMA_URIS which was called 15 times, avg 1µs/call: # 15 times (22µs+0s) by JSON::Schema::Modern::traverse at line 263 of JSON/Schema/Modern.pm, avg 1µs/call
sub JSON::Schema::Modern::METASCHEMA_URIS; # xsub
# spent 0s within JSON::Schema::Modern::SPECIFICATION_VERSION_DEFAULT which was called: # once (0s+0s) by JSON::Schema::Modern::Document::OpenAPI::traverse at line 76 of JSON/Schema/Modern/Document/OpenAPI.pm
sub JSON::Schema::Modern::SPECIFICATION_VERSION_DEFAULT; # xsub
# spent 1µs within JSON::Schema::Modern::__ANON__ which was called 2 times, avg 500ns/call: # once (1µs+0s) by JSON::Schema::Modern::BEGIN@34 at line 34 of JSON/Schema/Modern.pm # once (0s+0s) by JSON::Schema::Modern::BEGIN@33 at line 33 of JSON/Schema/Modern.pm
sub JSON::Schema::Modern::__ANON__; # xsub