| Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/darwin-2level/Encode/Encoding.pm |
| Statements | Executed 183465 statements in 293ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 183442 | 2 | 2 | 174ms | 174ms | Encode::Encoding::renewed |
| 1 | 1 | 1 | 25µs | 92µs | Encode::Encoding::BEGIN@14 |
| 1 | 1 | 1 | 23µs | 26µs | Encode::Encoding::BEGIN@4 |
| 1 | 1 | 1 | 14µs | 14µs | Encode::Encoding::CORE:match (opcode) |
| 1 | 1 | 1 | 12µs | 13µs | Encode::Encoding::BEGIN@12 |
| 1 | 1 | 1 | 9µs | 57µs | Encode::Encoding::BEGIN@5 |
| 1 | 1 | 1 | 8µs | 8µs | Encode::Encoding::renew |
| 1 | 1 | 1 | 4µs | 4µs | Encode::Encoding::BEGIN@10 |
| 1 | 1 | 1 | 3µs | 3µs | Encode::Encoding::BEGIN@11 |
| 1 | 1 | 1 | 1µs | 1µs | Encode::Encoding::__ANON__ (xsub) |
| 1 | 1 | 1 | 1µs | 1µs | Encode::Encoding::needs_lines |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::DESTROY |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::Define |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::decode |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::encode |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::fromUnicode |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::mime_name |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::name |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::perlio_ok |
| 0 | 0 | 0 | 0s | 0s | Encode::Encoding::toUnicode |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Encode::Encoding; | ||||
| 2 | |||||
| 3 | # Base class for classes which implement encodings | ||||
| 4 | 2 | 34µs | 2 | 29µs | # spent 26µs (23+3) within Encode::Encoding::BEGIN@4 which was called:
# once (23µs+3µs) by parent::import at line 4 # spent 26µs making 1 call to Encode::Encoding::BEGIN@4
# spent 3µs making 1 call to strict::import |
| 5 | 2 | 79µs | 2 | 105µs | # spent 57µs (9+48) within Encode::Encoding::BEGIN@5 which was called:
# once (9µs+48µs) by parent::import at line 5 # spent 57µs making 1 call to Encode::Encoding::BEGIN@5
# spent 48µs making 1 call to warnings::import |
| 6 | 3 | 34µs | 1 | 14µs | our $VERSION = do { my @r = ( q$Revision: 2.8 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; # spent 14µs making 1 call to Encode::Encoding::CORE:match |
| 7 | |||||
| 8 | 1 | 1µs | our @CARP_NOT = qw(Encode Encode::Encoder); | ||
| 9 | |||||
| 10 | 2 | 17µs | 1 | 4µs | # spent 4µs within Encode::Encoding::BEGIN@10 which was called:
# once (4µs+0s) by parent::import at line 10 # spent 4µs making 1 call to Encode::Encoding::BEGIN@10 |
| 11 | 2 | 25µs | 1 | 3µs | # spent 3µs within Encode::Encoding::BEGIN@11 which was called:
# once (3µs+0s) by parent::import at line 11 # spent 3µs making 1 call to Encode::Encoding::BEGIN@11 |
| 12 | 2 | 72µs | 2 | 14µs | # spent 13µs (12+1000ns) within Encode::Encoding::BEGIN@12 which was called:
# once (12µs+1000ns) by parent::import at line 12 # spent 13µs making 1 call to Encode::Encoding::BEGIN@12
# spent 1µs making 1 call to Encode::Encoding::__ANON__ |
| 13 | |||||
| 14 | 2 | 547µs | 2 | 159µs | # spent 92µs (25+67) within Encode::Encoding::BEGIN@14 which was called:
# once (25µs+67µs) by parent::import at line 14 # spent 92µs making 1 call to Encode::Encoding::BEGIN@14
# spent 67µs making 1 call to constant::import |
| 15 | |||||
| 16 | sub Define { | ||||
| 17 | my $obj = shift; | ||||
| 18 | my $canonical = shift; | ||||
| 19 | $obj = bless { Name => $canonical }, $obj unless ref $obj; | ||||
| 20 | |||||
| 21 | # warn "$canonical => $obj\n"; | ||||
| 22 | Encode::define_encoding( $obj, $canonical, @_ ); | ||||
| 23 | } | ||||
| 24 | |||||
| 25 | sub name { return shift->{'Name'} } | ||||
| 26 | |||||
| 27 | sub mime_name { | ||||
| 28 | return Encode::MIME::Name::get_mime_name(shift->name); | ||||
| 29 | } | ||||
| 30 | |||||
| 31 | # spent 8µs within Encode::Encoding::renew which was called:
# once (8µs+0s) by YAML::PP::Reader::File::CORE:open at line 56 of YAML/PP/Reader.pm | ||||
| 32 | 1 | 0s | my $self = shift; | ||
| 33 | 1 | 6µs | my $clone = bless {%$self} => ref($self); | ||
| 34 | 1 | 1µs | $clone->{renewed}++; # so the caller can see it | ||
| 35 | DEBUG and warn $clone->{renewed}; | ||||
| 36 | 1 | 4µs | return $clone; | ||
| 37 | } | ||||
| 38 | |||||
| 39 | 183442 | 293ms | # spent 174ms within Encode::Encoding::renewed which was called 183442 times, avg 947ns/call:
# 183003 times (173ms+0s) by Encode::utf8::decode at line 122 of Mojo/Util.pm, avg 944ns/call
# 439 times (984µs+0s) by Encode::utf8::decode at line 75 of YAML/PP/Reader.pm, avg 2µs/call | ||
| 40 | |||||
| 41 | 1 | 3µs | *new_sequence = \&renew; | ||
| 42 | |||||
| 43 | 1 | 3µs | # spent 1µs within Encode::Encoding::needs_lines which was called:
# once (1µs+0s) by YAML::PP::Reader::File::CORE:open at line 56 of YAML/PP/Reader.pm | ||
| 44 | |||||
| 45 | sub perlio_ok { | ||||
| 46 | return eval { require PerlIO::encoding } ? 1 : 0; | ||||
| 47 | } | ||||
| 48 | |||||
| 49 | # (Temporary|legacy) methods | ||||
| 50 | |||||
| 51 | sub toUnicode { shift->decode(@_) } | ||||
| 52 | sub fromUnicode { shift->encode(@_) } | ||||
| 53 | |||||
| 54 | # | ||||
| 55 | # Needs to be overloaded or just croak | ||||
| 56 | # | ||||
| 57 | |||||
| 58 | sub encode { | ||||
| 59 | my $obj = shift; | ||||
| 60 | my $class = ref($obj) ? ref($obj) : $obj; | ||||
| 61 | Carp::croak( $class . "->encode() not defined!" ); | ||||
| 62 | } | ||||
| 63 | |||||
| 64 | sub decode { | ||||
| 65 | my $obj = shift; | ||||
| 66 | my $class = ref($obj) ? ref($obj) : $obj; | ||||
| 67 | Carp::croak( $class . "->encode() not defined!" ); | ||||
| 68 | } | ||||
| 69 | |||||
| 70 | sub DESTROY { } | ||||
| 71 | |||||
| 72 | 1 | 11µs | 1; | ||
| 73 | __END__ | ||||
# spent 14µs within Encode::Encoding::CORE:match which was called:
# once (14µs+0s) by parent::import at line 6 | |||||
# spent 1µs within Encode::Encoding::__ANON__ which was called:
# once (1µs+0s) by Encode::Encoding::BEGIN@12 at line 12 |