← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Thu Dec 15 15:23:56 2022
Reported on Thu Dec 15 15:27:04 2022

Filename/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Schema/Core.pm
StatementsExecuted 17609 statements in 27.8ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
175701115.1ms15.1msYAML::PP::Schema::Core::::__ANON__[:70]YAML::PP::Schema::Core::__ANON__[:70]
111108µs473µsYAML::PP::Schema::Core::::registerYAML::PP::Schema::Core::register
11161µs61µsYAML::PP::Schema::Core::::CORE:regcompYAML::PP::Schema::Core::CORE:regcomp (opcode)
11130µs33µsModule::Load::::BEGIN@1 Module::Load::BEGIN@1
1117µs10µsYAML::PP::Schema::Core::::BEGIN@12YAML::PP::Schema::Core::BEGIN@12
5516µs6µsYAML::PP::Schema::Core::::CORE:qrYAML::PP::Schema::Core::CORE:qr (opcode)
1115µs32µsModule::Load::::BEGIN@2 Module::Load::BEGIN@2
1115µs17µsYAML::PP::Schema::Core::::BEGIN@14YAML::PP::Schema::Core::BEGIN@14
1115µs50µsYAML::PP::Schema::Core::::BEGIN@7YAML::PP::Schema::Core::BEGIN@7
0000s0sYAML::PP::Schema::Core::::_from_hexYAML::PP::Schema::Core::_from_hex
0000s0sYAML::PP::Schema::Core::::_from_octYAML::PP::Schema::Core::_from_oct
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1227µs236µs
# spent 33µs (30+3) within Module::Load::BEGIN@1 which was called: # once (30µs+3µs) by Module::Load::_load at line 1
use strict;
# spent 33µs making 1 call to Module::Load::BEGIN@1 # spent 3µs making 1 call to strict::import
2246µs259µs
# spent 32µs (5+27) within Module::Load::BEGIN@2 which was called: # once (5µs+27µs) by Module::Load::_load at line 2
use warnings;
# spent 32µs making 1 call to Module::Load::BEGIN@2 # spent 27µs making 1 call to warnings::import
3package YAML::PP::Schema::Core;
4
511µsour $VERSION = '0.035'; # VERSION
6
710s
# spent 50µs (5+45) within YAML::PP::Schema::Core::BEGIN@7 which was called: # once (5µs+45µs) by Module::Load::_load at line 10
use YAML::PP::Schema::JSON qw/
8 represent_int represent_float represent_literal represent_bool
9 represent_undef
10122µs295µs/;
# spent 50µs making 1 call to YAML::PP::Schema::Core::BEGIN@7 # spent 45µs making 1 call to Exporter::import
11
12218µs213µs
# spent 10µs (7+3) within YAML::PP::Schema::Core::BEGIN@12 which was called: # once (7µs+3µs) by Module::Load::_load at line 12
use B;
# spent 10µs making 1 call to YAML::PP::Schema::Core::BEGIN@12 # spent 3µs making 1 call to B::import
13
142423µs229µs
# spent 17µs (5+12) within YAML::PP::Schema::Core::BEGIN@14 which was called: # once (5µs+12µs) by Module::Load::_load at line 14
use YAML::PP::Common qw/ YAML_PLAIN_SCALAR_STYLE /;
# spent 17µs making 1 call to YAML::PP::Schema::Core::BEGIN@14 # spent 12µs making 1 call to Exporter::import
15
1619µs12µsmy $RE_INT_CORE = qr{^([+-]?(?:[0-9]+))$};
# spent 2µs making 1 call to YAML::PP::Schema::Core::CORE:qr
1712µs10smy $RE_FLOAT_CORE = qr{^([+-]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)(?:[eE][+-]?[0-9]+)?)$};
# spent 0s making 1 call to YAML::PP::Schema::Core::CORE:qr
1812µs11µsmy $RE_INT_OCTAL = qr{^0o([0-7]+)$};
# spent 1µs making 1 call to YAML::PP::Schema::Core::CORE:qr
1912µs11µsmy $RE_INT_HEX = qr{^0x([0-9a-fA-F]+)$};
# spent 1µs making 1 call to YAML::PP::Schema::Core::CORE:qr
20
21sub _from_oct { oct $_[2]->[0] }
22sub _from_hex { hex $_[2]->[0] }
23
24
# spent 473µs (108+365) within YAML::PP::Schema::Core::register which was called: # once (108µs+365µs) by YAML::PP::Schema::load_subschemas at line 141 of YAML/PP/Schema.pm
sub register {
2511µs my ($self, %args) = @_;
2611µs my $schema = $args{schema};
27
28 $schema->add_resolver(
29 tag => 'tag:yaml.org,2002:null',
30 match => [ equals => $_ => undef ],
3117µs539µs ) for (qw/ null NULL Null ~ /, '');
# spent 39µs making 5 calls to YAML::PP::Schema::add_resolver, avg 8µs/call
32 $schema->add_resolver(
33 tag => 'tag:yaml.org,2002:bool',
34 match => [ equals => $_ => $schema->true ],
3514µs619µs ) for (qw/ true TRUE True /);
# spent 18µs making 3 calls to YAML::PP::Schema::add_resolver, avg 6µs/call # spent 1µs making 3 calls to YAML::PP::Schema::true, avg 333ns/call
36 $schema->add_resolver(
37 tag => 'tag:yaml.org,2002:bool',
38 match => [ equals => $_ => $schema->false ],
3913µs620µs ) for (qw/ false FALSE False /);
# spent 19µs making 3 calls to YAML::PP::Schema::add_resolver, avg 6µs/call # spent 1µs making 3 calls to YAML::PP::Schema::false, avg 333ns/call
4012µs16µs $schema->add_resolver(
# spent 6µs making 1 call to YAML::PP::Schema::add_resolver
41 tag => 'tag:yaml.org,2002:int',
42 match => [ regex => $RE_INT_CORE => \&YAML::PP::Schema::JSON::_to_int ],
43 );
4412µs17µs $schema->add_resolver(
# spent 7µs making 1 call to YAML::PP::Schema::add_resolver
45 tag => 'tag:yaml.org,2002:int',
46 match => [ regex => $RE_INT_OCTAL => \&_from_oct ],
47 );
4811µs19µs $schema->add_resolver(
# spent 9µs making 1 call to YAML::PP::Schema::add_resolver
49 tag => 'tag:yaml.org,2002:int',
50 match => [ regex => $RE_INT_HEX => \&_from_hex ],
51 );
5212µs18µs $schema->add_resolver(
# spent 8µs making 1 call to YAML::PP::Schema::add_resolver
53 tag => 'tag:yaml.org,2002:float',
54 match => [ regex => $RE_FLOAT_CORE => \&YAML::PP::Schema::JSON::_to_float ],
55 );
56 $schema->add_resolver(
57 tag => 'tag:yaml.org,2002:float',
58 match => [ equals => $_ => 0 + "inf" ],
5916µs635µs ) for (qw/ .inf .Inf .INF +.inf +.Inf +.INF /);
# spent 35µs making 6 calls to YAML::PP::Schema::add_resolver, avg 6µs/call
60 $schema->add_resolver(
61 tag => 'tag:yaml.org,2002:float',
62 match => [ equals => $_ => 0 - "inf" ],
6312µs321µs ) for (qw/ -.inf -.Inf -.INF /);
# spent 21µs making 3 calls to YAML::PP::Schema::add_resolver, avg 7µs/call
64 $schema->add_resolver(
65 tag => 'tag:yaml.org,2002:float',
66 match => [ equals => $_ => 0 + "nan" ],
6712µs319µs ) for (qw/ .nan .NaN .NAN /);
# spent 19µs making 3 calls to YAML::PP::Schema::add_resolver, avg 6µs/call
68 $schema->add_resolver(
69 tag => 'tag:yaml.org,2002:str',
701757127.1ms16µs
# spent 15.1ms within YAML::PP::Schema::Core::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Schema/Core.pm:70] which was called 17570 times, avg 861ns/call: # 17570 times (15.1ms+0s) by YAML::PP::Schema::load_scalar at line 348 of YAML/PP/Schema.pm, avg 861ns/call
match => [ all => sub { $_[1]->{value} } ],
# spent 6µs making 1 call to YAML::PP::Schema::add_resolver
71 );
72
7310s my $int_flags = B::SVp_IOK;
7410s my $float_flags = B::SVp_NOK;
7512µs19µs $schema->add_representer(
# spent 9µs making 1 call to YAML::PP::Schema::add_representer
76 flags => $int_flags,
77 code => \&represent_int,
78 );
7911µs13µs $schema->add_representer(
# spent 3µs making 1 call to YAML::PP::Schema::add_representer
80 flags => $float_flags,
81 code => \&represent_float,
82 );
8311µs17µs $schema->add_representer(
# spent 7µs making 1 call to YAML::PP::Schema::add_representer
84 undefined => \&represent_undef,
85 );
86 $schema->add_representer(
87 equals => $_,
88 code => \&represent_literal,
89116µs2380µs ) for ("", qw/
# spent 80µs making 23 calls to YAML::PP::Schema::add_representer, avg 3µs/call
90 true TRUE True false FALSE False null NULL Null ~
91 .inf .Inf .INF +.inf +.Inf +.INF -.inf -.Inf -.INF .nan .NaN .NAN
92 /);
93173µs367µs $schema->add_representer(
# spent 61µs making 1 call to YAML::PP::Schema::Core::CORE:regcomp # spent 4µs making 1 call to YAML::PP::Schema::add_representer # spent 2µs making 1 call to YAML::PP::Schema::Core::CORE:qr
94 regex => qr{$RE_INT_CORE|$RE_FLOAT_CORE|$RE_INT_OCTAL|$RE_INT_HEX},
95 code => \&represent_literal,
96 );
97
9813µs22µs if ($schema->bool_class) {
# spent 2µs making 2 calls to YAML::PP::Schema::bool_class, avg 1µs/call
99 for my $class (@{ $schema->bool_class }) {
10011µs18µs $schema->add_representer(
# spent 8µs making 1 call to YAML::PP::Schema::add_representer
101 class_equals => $class,
102 code => \&represent_bool,
103 );
104 }
105 }
106
10713µs return;
108}
109
11013µs1;
111
112__END__
 
# spent 6µs within YAML::PP::Schema::Core::CORE:qr which was called 5 times, avg 1µs/call: # once (2µs+0s) by YAML::PP::Schema::Core::register at line 93 # once (2µs+0s) by Module::Load::_load at line 16 # once (1µs+0s) by Module::Load::_load at line 19 # once (1µs+0s) by Module::Load::_load at line 18 # once (0s+0s) by Module::Load::_load at line 17
sub YAML::PP::Schema::Core::CORE:qr; # opcode
# spent 61µs within YAML::PP::Schema::Core::CORE:regcomp which was called: # once (61µs+0s) by YAML::PP::Schema::Core::register at line 93
sub YAML::PP::Schema::Core::CORE:regcomp; # opcode