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

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/JSON/Schema/Modern/Error.pm
StatementsExecuted 4257 statements in 20.7ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
42171126.5ms80.9msJSON::Schema::Modern::Error::::__ANON__[:39]JSON::Schema::Modern::Error::__ANON__[:39]
1119.60ms13.1msJSON::Schema::Modern::Error::::BEGIN@18JSON::Schema::Modern::Error::BEGIN@18
1111.73ms17.2msJSON::Schema::Modern::Error::::BEGIN@21JSON::Schema::Modern::Error::BEGIN@21
111167µs170µsJSON::Schema::Modern::::BEGIN@1.66 JSON::Schema::Modern::BEGIN@1.66
11120µs793µsJSON::Schema::Modern::Error::::BEGIN@11JSON::Schema::Modern::Error::BEGIN@11
11117µs634µsJSON::Schema::Modern::Error::::BEGIN@20JSON::Schema::Modern::Error::BEGIN@20
11114µs35µsJSON::Schema::Modern::Error::::BEGIN@13JSON::Schema::Modern::Error::BEGIN@13
11114µs14µsJSON::Schema::Modern::Error::::BEGIN@9JSON::Schema::Modern::Error::BEGIN@9
11112µs50µsJSON::Schema::Modern::::BEGIN@2.67 JSON::Schema::Modern::BEGIN@2.67
11111µs35µsJSON::Schema::Modern::Error::::BEGIN@24JSON::Schema::Modern::Error::BEGIN@24
1119µs281µsJSON::Schema::Modern::Error::::BEGIN@10JSON::Schema::Modern::Error::BEGIN@10
1119µs584µsJSON::Schema::Modern::Error::::BEGIN@19JSON::Schema::Modern::Error::BEGIN@19
1118µs88µsJSON::Schema::Modern::Error::::BEGIN@12JSON::Schema::Modern::Error::BEGIN@12
1118µs20µsJSON::Schema::Modern::Error::::BEGIN@14JSON::Schema::Modern::Error::BEGIN@14
1118µs16µsJSON::Schema::Modern::Error::::BEGIN@16JSON::Schema::Modern::Error::BEGIN@16
1116µs16µsJSON::Schema::Modern::Error::::BEGIN@15JSON::Schema::Modern::Error::BEGIN@15
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
12229µs2173µs
# spent 170µs (167+3) within JSON::Schema::Modern::BEGIN@1.66 which was called: # once (167µs+3µs) by JSON::Schema::Modern::BEGIN@33 at line 1
use strict;
# spent 170µs making 1 call to JSON::Schema::Modern::BEGIN@1.66 # spent 3µs making 1 call to strict::import
2265µs288µs
# spent 50µs (12+38) within JSON::Schema::Modern::BEGIN@2.67 which was called: # once (12µs+38µs) by JSON::Schema::Modern::BEGIN@33 at line 2
use warnings;
# spent 50µs making 1 call to JSON::Schema::Modern::BEGIN@2.67 # spent 38µ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.552';
8
9249µs114µs
# spent 14µs within JSON::Schema::Modern::Error::BEGIN@9 which was called: # once (14µs+0s) by JSON::Schema::Modern::BEGIN@33 at line 9
use 5.020;
# spent 14µs making 1 call to JSON::Schema::Modern::Error::BEGIN@9
10233µs2553µs
# spent 281µs (9+272) within JSON::Schema::Modern::Error::BEGIN@10 which was called: # once (9µs+272µs) by JSON::Schema::Modern::BEGIN@33 at line 10
use Moo;
# spent 281µs making 1 call to JSON::Schema::Modern::Error::BEGIN@10 # spent 272µs making 1 call to Moo::import
11334µs31.56ms
# spent 793µs (20+773) within JSON::Schema::Modern::Error::BEGIN@11 which was called: # once (20µs+773µs) by JSON::Schema::Modern::BEGIN@33 at line 11
use strictures 2;
# spent 793µs making 1 call to JSON::Schema::Modern::Error::BEGIN@11 # spent 751µs making 1 call to strictures::import # spent 21µs making 1 call to strictures::VERSION
12239µs2168µs
# spent 88µs (8+80) within JSON::Schema::Modern::Error::BEGIN@12 which was called: # once (8µs+80µs) by JSON::Schema::Modern::BEGIN@33 at line 12
use experimental qw(signatures postderef);
# spent 88µs making 1 call to JSON::Schema::Modern::Error::BEGIN@12 # spent 80µs making 1 call to experimental::import
13224µs238µs
# spent 35µs (14+21) within JSON::Schema::Modern::Error::BEGIN@13 which was called: # once (14µs+21µs) by JSON::Schema::Modern::BEGIN@33 at line 13
use if "$]" >= 5.022, experimental => 're_strict';
# spent 35µs making 1 call to JSON::Schema::Modern::Error::BEGIN@13 # spent 3µs making 1 call to if::import
14217µs221µs
# spent 20µs (8+12) within JSON::Schema::Modern::Error::BEGIN@14 which was called: # once (8µs+12µs) by JSON::Schema::Modern::BEGIN@33 at line 14
no if "$]" >= 5.031009, feature => 'indirect';
# spent 20µs making 1 call to JSON::Schema::Modern::Error::BEGIN@14 # spent 1µs making 1 call to if::unimport
15216µs217µs
# spent 16µs (6+10) within JSON::Schema::Modern::Error::BEGIN@15 which was called: # once (6µs+10µs) by JSON::Schema::Modern::BEGIN@33 at line 15
no if "$]" >= 5.033001, feature => 'multidimensional';
# spent 16µs making 1 call to JSON::Schema::Modern::Error::BEGIN@15 # spent 1µs making 1 call to if::unimport
16214µs218µ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 2µs making 1 call to if::unimport
17217µ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
182768µs113.1ms
# spent 13.1ms (9.60+3.48) within JSON::Schema::Modern::Error::BEGIN@18 which was called: # once (9.60ms+3.48ms) by JSON::Schema::Modern::BEGIN@33 at line 18
use JSON::PP ();
# spent 13.1ms making 1 call to JSON::Schema::Modern::Error::BEGIN@18
19246µs21.16ms
# spent 584µs (9+575) within JSON::Schema::Modern::Error::BEGIN@19 which was called: # once (9µs+575µs) by JSON::Schema::Modern::BEGIN@33 at line 19
use MooX::TypeTiny;
# spent 584µs making 1 call to JSON::Schema::Modern::Error::BEGIN@19 # spent 575µs making 1 call to MooX::TypeTiny::import
20239µs21.25ms
# spent 634µs (17+617) within JSON::Schema::Modern::Error::BEGIN@20 which was called: # once (17µs+617µs) by JSON::Schema::Modern::BEGIN@33 at line 20
use Types::Standard qw(Str Undef InstanceOf Enum);
# spent 634µs making 1 call to JSON::Schema::Modern::Error::BEGIN@20 # spent 617µs making 1 call to Exporter::Tiny::import
212993µs217.4ms
# spent 17.2ms (1.73+15.5) within JSON::Schema::Modern::Error::BEGIN@21 which was called: # once (1.73ms+15.5ms) by JSON::Schema::Modern::BEGIN@33 at line 21
use namespace::clean;
# spent 17.2ms making 1 call to JSON::Schema::Modern::Error::BEGIN@21 # spent 234µs making 1 call to namespace::clean::import
22
23use overload
242310µs259µs
# spent 35µs (11+24) within JSON::Schema::Modern::Error::BEGIN@24 which was called: # once (11µs+24µs) by JSON::Schema::Modern::BEGIN@33 at line 24
'""' => sub { $_[0]->stringify };
# spent 35µs making 1 call to JSON::Schema::Modern::Error::BEGIN@24 # spent 24µs making 1 call to overload::import
25
2615µ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'],
39421717.9ms421754.5ms
# spent 80.9ms (26.5+54.5) 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 (26.5ms+54.5ms) 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 54.5ms making 4217 calls to Safe::Isa::__ANON__[Safe/Isa.pm:23], avg 13µs/call
40111µs25.10ms);
# spent 4.20ms making 1 call to Types::Standard::InstanceOf # spent 901µs making 1 call to JSON::Schema::Modern::Error::has
41
42113µs44.40mshas keyword => (
# spent 3.48ms making 1 call to Type::Tiny::__ANON__[Type/Tiny.pm:126] # spent 912µs making 1 call to JSON::Schema::Modern::Error::has # spent 3µs making 1 call to Types::Standard::Undef # spent 2µs making 1 call to Types::Standard::Str
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µs21.11ms);
# spent 652µs making 1 call to JSON::Schema::Modern::Error::has # spent 454µs making 1 call to Types::Standard::InstanceOf
53
5416µs25.18mshas mode => (
# spent 4.11ms making 1 call to Types::Standard::Enum # spent 1.07ms 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 ? 'at \''.$self->keyword_location.'\': '.$self->error
73 : 'at \''.$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
82123µs1;
83
84140µs1664µs__END__