| Filename | /Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Schema/Core.pm |
| Statements | Executed 17752 statements in 36.5ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 17713 | 1 | 1 | 23.4ms | 23.4ms | YAML::PP::Schema::Core::__ANON__[:70] |
| 1 | 1 | 1 | 277µs | 1.02ms | YAML::PP::Schema::Core::register |
| 1 | 1 | 1 | 94µs | 94µs | YAML::PP::Schema::Core::CORE:regcomp (opcode) |
| 1 | 1 | 1 | 49µs | 55µs | Module::Load::BEGIN@1 |
| 1 | 1 | 1 | 22µs | 24µs | YAML::PP::Schema::Core::BEGIN@12 |
| 5 | 5 | 1 | 16µs | 16µs | YAML::PP::Schema::Core::CORE:qr (opcode) |
| 1 | 1 | 1 | 16µs | 83µs | Module::Load::BEGIN@2 |
| 1 | 1 | 1 | 11µs | 106µs | YAML::PP::Schema::Core::BEGIN@7 |
| 1 | 1 | 1 | 6µs | 30µs | YAML::PP::Schema::Core::BEGIN@14 |
| 0 | 0 | 0 | 0s | 0s | YAML::PP::Schema::Core::_from_hex |
| 0 | 0 | 0 | 0s | 0s | YAML::PP::Schema::Core::_from_oct |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | 2 | 68µs | 2 | 61µs | # spent 55µs (49+6) within Module::Load::BEGIN@1 which was called:
# once (49µs+6µs) by Module::Load::_load at line 1 # spent 55µs making 1 call to Module::Load::BEGIN@1
# spent 6µs making 1 call to strict::import |
| 2 | 2 | 90µs | 2 | 150µs | # spent 83µs (16+67) within Module::Load::BEGIN@2 which was called:
# once (16µs+67µs) by Module::Load::_load at line 2 # spent 83µs making 1 call to Module::Load::BEGIN@2
# spent 67µs making 1 call to warnings::import |
| 3 | package YAML::PP::Schema::Core; | ||||
| 4 | |||||
| 5 | 1 | 1µs | our $VERSION = '0.035'; # VERSION | ||
| 6 | |||||
| 7 | 1 | 1µs | # spent 106µs (11+95) within YAML::PP::Schema::Core::BEGIN@7 which was called:
# once (11µs+95µs) by Module::Load::_load at line 10 | ||
| 8 | represent_int represent_float represent_literal represent_bool | ||||
| 9 | represent_undef | ||||
| 10 | 1 | 43µs | 2 | 201µs | /; # spent 106µs making 1 call to YAML::PP::Schema::Core::BEGIN@7
# spent 95µs making 1 call to Exporter::import |
| 11 | |||||
| 12 | 2 | 32µs | 2 | 26µs | # spent 24µs (22+2) within YAML::PP::Schema::Core::BEGIN@12 which was called:
# once (22µs+2µs) by Module::Load::_load at line 12 # spent 24µs making 1 call to YAML::PP::Schema::Core::BEGIN@12
# spent 2µs making 1 call to B::import |
| 13 | |||||
| 14 | 2 | 800µs | 2 | 54µs | # spent 30µs (6+24) within YAML::PP::Schema::Core::BEGIN@14 which was called:
# once (6µs+24µs) by Module::Load::_load at line 14 # spent 30µs making 1 call to YAML::PP::Schema::Core::BEGIN@14
# spent 24µs making 1 call to Exporter::import |
| 15 | |||||
| 16 | 1 | 24µs | 1 | 11µs | my $RE_INT_CORE = qr{^([+-]?(?:[0-9]+))$}; # spent 11µs making 1 call to YAML::PP::Schema::Core::CORE:qr |
| 17 | 1 | 3µs | 1 | 1µs | my $RE_FLOAT_CORE = qr{^([+-]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)(?:[eE][+-]?[0-9]+)?)$}; # spent 1µs making 1 call to YAML::PP::Schema::Core::CORE:qr |
| 18 | 1 | 2µs | 1 | 0s | my $RE_INT_OCTAL = qr{^0o([0-7]+)$}; # spent 0s making 1 call to YAML::PP::Schema::Core::CORE:qr |
| 19 | 1 | 2µs | 1 | 1µs | my $RE_INT_HEX = qr{^0x([0-9a-fA-F]+)$}; # spent 1µs making 1 call to YAML::PP::Schema::Core::CORE:qr |
| 20 | |||||
| 21 | sub _from_oct { oct $_[2]->[0] } | ||||
| 22 | sub _from_hex { hex $_[2]->[0] } | ||||
| 23 | |||||
| 24 | # spent 1.02ms (277µs+740µs) within YAML::PP::Schema::Core::register which was called:
# once (277µs+740µs) by YAML::PP::Schema::load_subschemas at line 141 of YAML/PP/Schema.pm | ||||
| 25 | 1 | 4µs | my ($self, %args) = @_; | ||
| 26 | 1 | 1µs | my $schema = $args{schema}; | ||
| 27 | |||||
| 28 | $schema->add_resolver( | ||||
| 29 | tag => 'tag:yaml.org,2002:null', | ||||
| 30 | match => [ equals => $_ => undef ], | ||||
| 31 | 1 | 12µs | 5 | 111µs | ) for (qw/ null NULL Null ~ /, ''); # spent 111µs making 5 calls to YAML::PP::Schema::add_resolver, avg 22µs/call |
| 32 | $schema->add_resolver( | ||||
| 33 | tag => 'tag:yaml.org,2002:bool', | ||||
| 34 | match => [ equals => $_ => $schema->true ], | ||||
| 35 | 1 | 11µs | 6 | 50µs | ) for (qw/ true TRUE True /); # spent 45µs making 3 calls to YAML::PP::Schema::add_resolver, avg 15µs/call
# spent 5µs making 3 calls to YAML::PP::Schema::true, avg 2µs/call |
| 36 | $schema->add_resolver( | ||||
| 37 | tag => 'tag:yaml.org,2002:bool', | ||||
| 38 | match => [ equals => $_ => $schema->false ], | ||||
| 39 | 1 | 10µs | 6 | 52µs | ) for (qw/ false FALSE False /); # spent 50µs making 3 calls to YAML::PP::Schema::add_resolver, avg 17µs/call
# spent 2µs making 3 calls to YAML::PP::Schema::false, avg 667ns/call |
| 40 | 1 | 2µs | 1 | 41µs | $schema->add_resolver( # spent 41µ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 | ); | ||||
| 44 | 1 | 4µs | 1 | 22µs | $schema->add_resolver( # spent 22µ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 | ); | ||||
| 48 | 1 | 3µs | 1 | 9µ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 | ); | ||||
| 52 | 1 | 3µs | 1 | 11µs | $schema->add_resolver( # spent 11µ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" ], | ||||
| 59 | 1 | 15µs | 6 | 68µs | ) for (qw/ .inf .Inf .INF +.inf +.Inf +.INF /); # spent 68µs making 6 calls to YAML::PP::Schema::add_resolver, avg 11µs/call |
| 60 | $schema->add_resolver( | ||||
| 61 | tag => 'tag:yaml.org,2002:float', | ||||
| 62 | match => [ equals => $_ => 0 - "inf" ], | ||||
| 63 | 1 | 5µs | 3 | 29µs | ) for (qw/ -.inf -.Inf -.INF /); # spent 29µs making 3 calls to YAML::PP::Schema::add_resolver, avg 10µs/call |
| 64 | $schema->add_resolver( | ||||
| 65 | tag => 'tag:yaml.org,2002:float', | ||||
| 66 | match => [ equals => $_ => 0 + "nan" ], | ||||
| 67 | 1 | 8µs | 3 | 25µs | ) for (qw/ .nan .NaN .NAN /); # spent 25µs making 3 calls to YAML::PP::Schema::add_resolver, avg 8µs/call |
| 68 | $schema->add_resolver( | ||||
| 69 | tag => 'tag:yaml.org,2002:str', | ||||
| 70 | 17714 | 35.1ms | 1 | 11µs | # spent 23.4ms within YAML::PP::Schema::Core::__ANON__[/Users/ether/.perlbrew/libs/36.0@std/lib/perl5/YAML/PP/Schema/Core.pm:70] which was called 17713 times, avg 1µs/call:
# 17713 times (23.4ms+0s) by YAML::PP::Schema::load_scalar at line 348 of YAML/PP/Schema.pm, avg 1µs/call # spent 11µs making 1 call to YAML::PP::Schema::add_resolver |
| 71 | ); | ||||
| 72 | |||||
| 73 | 1 | 0s | my $int_flags = B::SVp_IOK; | ||
| 74 | 1 | 1µs | my $float_flags = B::SVp_NOK; | ||
| 75 | 1 | 4µs | 1 | 18µs | $schema->add_representer( # spent 18µs making 1 call to YAML::PP::Schema::add_representer |
| 76 | flags => $int_flags, | ||||
| 77 | code => \&represent_int, | ||||
| 78 | ); | ||||
| 79 | 1 | 2µs | 1 | 3µ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 | ); | ||||
| 83 | 1 | 2µs | 1 | 13µs | $schema->add_representer( # spent 13µ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, | ||||
| 89 | 1 | 34µs | 23 | 167µs | ) for ("", qw/ # spent 167µs making 23 calls to YAML::PP::Schema::add_representer, avg 7µ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 | /); | ||||
| 93 | 1 | 110µs | 3 | 103µs | $schema->add_representer( # spent 94µs making 1 call to YAML::PP::Schema::Core::CORE:regcomp
# spent 6µs making 1 call to YAML::PP::Schema::add_representer
# spent 3µ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 | |||||
| 98 | 1 | 4µs | 2 | 3µs | if ($schema->bool_class) { # spent 3µs making 2 calls to YAML::PP::Schema::bool_class, avg 2µs/call |
| 99 | for my $class (@{ $schema->bool_class }) { | ||||
| 100 | 1 | 1µs | 1 | 4µs | $schema->add_representer( # spent 4µs making 1 call to YAML::PP::Schema::add_representer |
| 101 | class_equals => $class, | ||||
| 102 | code => \&represent_bool, | ||||
| 103 | ); | ||||
| 104 | } | ||||
| 105 | } | ||||
| 106 | |||||
| 107 | 1 | 5µs | return; | ||
| 108 | } | ||||
| 109 | |||||
| 110 | 1 | 16µs | 1; | ||
| 111 | |||||
| 112 | __END__ | ||||
# spent 16µs within YAML::PP::Schema::Core::CORE:qr which was called 5 times, avg 3µs/call:
# once (11µs+0s) by Module::Load::_load at line 16
# once (3µs+0s) by YAML::PP::Schema::Core::register at line 93
# once (1µs+0s) by Module::Load::_load at line 19
# once (1µs+0s) by Module::Load::_load at line 17
# once (0s+0s) by Module::Load::_load at line 18 | |||||
# spent 94µs within YAML::PP::Schema::Core::CORE:regcomp which was called:
# once (94µs+0s) by YAML::PP::Schema::Core::register at line 93 |