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

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm
StatementsExecuted 4257 statements in 20.1ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
42171121.3ms78.5msJSON::Schema::Modern::Error::::__ANON__[:39]JSON::Schema::Modern::Error::__ANON__[:39]
1117.43ms10.2msJSON::Schema::Modern::Error::::BEGIN@18JSON::Schema::Modern::Error::BEGIN@18
1112.06ms16.4msJSON::Schema::Modern::Error::::BEGIN@21JSON::Schema::Modern::Error::BEGIN@21
11132µs35µsJSON::Schema::Modern::::BEGIN@1.66 JSON::Schema::Modern::BEGIN@1.66
11120µs54µsJSON::Schema::Modern::Error::::BEGIN@13JSON::Schema::Modern::Error::BEGIN@13
11115µs877µsJSON::Schema::Modern::Error::::BEGIN@20JSON::Schema::Modern::Error::BEGIN@20
11113µs640µsJSON::Schema::Modern::Error::::BEGIN@11JSON::Schema::Modern::Error::BEGIN@11
11113µs36µsJSON::Schema::Modern::Error::::BEGIN@24JSON::Schema::Modern::Error::BEGIN@24
11110µs10µsJSON::Schema::Modern::Error::::BEGIN@9JSON::Schema::Modern::Error::BEGIN@9
1119µs360µsJSON::Schema::Modern::Error::::BEGIN@19JSON::Schema::Modern::Error::BEGIN@19
1118µs17µsJSON::Schema::Modern::Error::::BEGIN@14JSON::Schema::Modern::Error::BEGIN@14
1118µs17µsJSON::Schema::Modern::Error::::BEGIN@15JSON::Schema::Modern::Error::BEGIN@15
1118µs16µsJSON::Schema::Modern::Error::::BEGIN@16JSON::Schema::Modern::Error::BEGIN@16
1116µs37µsJSON::Schema::Modern::::BEGIN@2.67 JSON::Schema::Modern::BEGIN@2.67
1116µs190µsJSON::Schema::Modern::Error::::BEGIN@10JSON::Schema::Modern::Error::BEGIN@10
1116µs93µsJSON::Schema::Modern::Error::::BEGIN@12JSON::Schema::Modern::Error::BEGIN@12
1115µs88µsJSON::Schema::Modern::Error::::BEGIN@17JSON::Schema::Modern::Error::BEGIN@17
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
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1232µs238µs
# spent 35µs (32+3) within JSON::Schema::Modern::BEGIN@1.66 which was called: # once (32µs+3µs) by JSON::Schema::Modern::BEGIN@33 at line 1
use strict;
# spent 35µs making 1 call to JSON::Schema::Modern::BEGIN@1.66 # spent 3µs making 1 call to strict::import
2238µs268µs
# spent 37µs (6+31) within JSON::Schema::Modern::BEGIN@2.67 which was called: # once (6µs+31µs) by JSON::Schema::Modern::BEGIN@33 at line 2
use warnings;
# spent 37µs making 1 call to JSON::Schema::Modern::BEGIN@2.67 # spent 31µ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
711µsour $VERSION = '0.556';
8
9227µs110µs
# spent 10µs within JSON::Schema::Modern::Error::BEGIN@9 which was called: # once (10µs+0s) by JSON::Schema::Modern::BEGIN@33 at line 9
use 5.020;
# spent 10µs making 1 call to JSON::Schema::Modern::Error::BEGIN@9
10225µs2374µs
# spent 190µs (6+184) within JSON::Schema::Modern::Error::BEGIN@10 which was called: # once (6µs+184µs) by JSON::Schema::Modern::BEGIN@33 at line 10
use Moo;
# spent 190µs making 1 call to JSON::Schema::Modern::Error::BEGIN@10 # spent 184µs making 1 call to Moo::import
11342µs31.27ms
# spent 640µs (13+627) within JSON::Schema::Modern::Error::BEGIN@11 which was called: # once (13µs+627µs) by JSON::Schema::Modern::BEGIN@33 at line 11
use strictures 2;
# spent 640µs making 1 call to JSON::Schema::Modern::Error::BEGIN@11 # spent 612µs making 1 call to strictures::import # spent 15µs making 1 call to strictures::VERSION
12233µs2180µs
# spent 93µs (6+87) within JSON::Schema::Modern::Error::BEGIN@12 which was called: # once (6µs+87µs) by JSON::Schema::Modern::BEGIN@33 at line 12
use experimental qw(signatures postderef);
# spent 93µs making 1 call to JSON::Schema::Modern::Error::BEGIN@12 # spent 87µs making 1 call to experimental::import
13227µs256µs
# spent 54µs (20+34) within JSON::Schema::Modern::Error::BEGIN@13 which was called: # once (20µs+34µs) by JSON::Schema::Modern::BEGIN@33 at line 13
use if "$]" >= 5.022, experimental => 're_strict';
# spent 54µs making 1 call to JSON::Schema::Modern::Error::BEGIN@13 # spent 2µs making 1 call to if::import
14218µs218µs
# spent 17µs (8+9) within JSON::Schema::Modern::Error::BEGIN@14 which was called: # once (8µs+9µs) by JSON::Schema::Modern::BEGIN@33 at line 14
no if "$]" >= 5.031009, feature => 'indirect';
# spent 17µs making 1 call to JSON::Schema::Modern::Error::BEGIN@14 # spent 1µs making 1 call to if::unimport
15219µs218µs
# spent 17µs (8+9) within JSON::Schema::Modern::Error::BEGIN@15 which was called: # once (8µs+9µs) by JSON::Schema::Modern::BEGIN@33 at line 15
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 17µs making 1 call to JSON::Schema::Modern::Error::BEGIN@15 # spent 1µs making 1 call to if::unimport
16213µs216µs
# spent 16µs (8+8) within JSON::Schema::Modern::Error::BEGIN@16 which was called: # once (8µs+8µs) by JSON::Schema::Modern::BEGIN@33 at line 16
no if "$]" >= 5.033006, feature => 'bareword_filehandles';
# spent 16µs making 1 call to JSON::Schema::Modern::Error::BEGIN@16 # spent 0s making 1 call to if::unimport
17218µs2171µs
# spent 88µs (5+83) within JSON::Schema::Modern::Error::BEGIN@17 which was called: # once (5µs+83µs) by JSON::Schema::Modern::BEGIN@33 at line 17
use Safe::Isa;
# spent 88µs making 1 call to JSON::Schema::Modern::Error::BEGIN@17 # spent 83µs making 1 call to Exporter::import
182226µs110.2ms
# spent 10.2ms (7.43+2.73) within JSON::Schema::Modern::Error::BEGIN@18 which was called: # once (7.43ms+2.73ms) by JSON::Schema::Modern::BEGIN@33 at line 18
use JSON::PP ();
# spent 10.2ms making 1 call to JSON::Schema::Modern::Error::BEGIN@18
19230µs2711µs
# spent 360µs (9+351) within JSON::Schema::Modern::Error::BEGIN@19 which was called: # once (9µs+351µs) by JSON::Schema::Modern::BEGIN@33 at line 19
use MooX::TypeTiny;
# spent 360µs making 1 call to JSON::Schema::Modern::Error::BEGIN@19 # spent 351µs making 1 call to MooX::TypeTiny::import
202113µs21.74ms
# spent 877µs (15+862) within JSON::Schema::Modern::Error::BEGIN@20 which was called: # once (15µs+862µs) by JSON::Schema::Modern::BEGIN@33 at line 20
use Types::Standard qw(Str Undef InstanceOf Enum);
# spent 877µs making 1 call to JSON::Schema::Modern::Error::BEGIN@20 # spent 862µs making 1 call to Exporter::Tiny::import
212944µs216.8ms
# spent 16.4ms (2.06+14.4) within JSON::Schema::Modern::Error::BEGIN@21 which was called: # once (2.06ms+14.4ms) by JSON::Schema::Modern::BEGIN@33 at line 21
use namespace::clean;
# spent 16.4ms making 1 call to JSON::Schema::Modern::Error::BEGIN@21 # spent 389µs making 1 call to namespace::clean::import
22
23use overload
242501µs259µs
# spent 36µs (13+23) within JSON::Schema::Modern::Error::BEGIN@24 which was called: # once (13µs+23µs) by JSON::Schema::Modern::BEGIN@33 at line 24
'""' => sub { $_[0]->stringify };
# spent 36µs making 1 call to JSON::Schema::Modern::Error::BEGIN@24 # spent 23µs making 1 call to overload::import
25
2615µs222.4mshas [qw(
# spent 22.4ms making 1 call to JSON::Schema::Modern::Error::has # spent 1µ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'],
39421717.9ms421757.2ms
# spent 78.5ms (21.3+57.2) 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 19µs/call: # 4217 times (21.3ms+57.2ms) by JSON::Schema::Modern::Error::new at line 68 of (eval 432)[Sub/Quote.pm:3], avg 19µs/call
coerce => sub { $_[0]->$_isa('Mojo::URL') ? $_[0] : Mojo::URL->new($_[0]) },
# spent 57.2ms making 4217 calls to Safe::Isa::__ANON__[Safe/Isa.pm:23], avg 14µs/call
40110µs24.77ms);
# spent 4.03ms making 1 call to Types::Standard::InstanceOf # spent 746µs making 1 call to JSON::Schema::Modern::Error::has
41
42114µs43.47mshas keyword => (
# spent 2.71ms making 1 call to Type::Tiny::__ANON__[Type/Tiny.pm:126] # spent 760µs making 1 call to JSON::Schema::Modern::Error::has # spent 2µs making 1 call to Types::Standard::Str # spent 2µ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 },
5215µs2837µs);
# spent 480µs making 1 call to JSON::Schema::Modern::Error::has # spent 357µs making 1 call to Types::Standard::InstanceOf
53
5416µs24.00mshas mode => (
# spent 2.94ms making 1 call to Types::Standard::Enum # spent 1.06ms 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
82122µs1;
83
84148µs1527µs__END__