Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/darwin-2level/Encode/Encoding.pm |
Statements | Executed 187751 statements in 263ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
187728 | 2 | 2 | 156ms | 156ms | renewed | Encode::Encoding::
1 | 1 | 1 | 53µs | 131µs | BEGIN@4 | Encode::Encoding::
1 | 1 | 1 | 12µs | 54µs | BEGIN@5 | Encode::Encoding::
1 | 1 | 1 | 11µs | 77µs | BEGIN@14 | Encode::Encoding::
1 | 1 | 1 | 10µs | 11µs | BEGIN@12 | Encode::Encoding::
1 | 1 | 1 | 6µs | 6µs | renew | Encode::Encoding::
1 | 1 | 1 | 5µs | 5µs | CORE:match (opcode) | Encode::Encoding::
1 | 1 | 1 | 4µs | 4µs | BEGIN@10 | Encode::Encoding::
1 | 1 | 1 | 2µs | 2µs | needs_lines | Encode::Encoding::
1 | 1 | 1 | 1µs | 1µs | BEGIN@11 | Encode::Encoding::
1 | 1 | 1 | 1µs | 1µs | __ANON__ (xsub) | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | DESTROY | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | Define | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | decode | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | encode | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | fromUnicode | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | mime_name | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | name | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | perlio_ok | Encode::Encoding::
0 | 0 | 0 | 0s | 0s | toUnicode | Encode::Encoding::
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 | 147µs | 2 | 209µs | # spent 131µs (53+78) within Encode::Encoding::BEGIN@4 which was called:
# once (53µs+78µs) by parent::import at line 4 # spent 131µs making 1 call to Encode::Encoding::BEGIN@4
# spent 78µs making 1 call to strict::import |
5 | 2 | 108µs | 2 | 96µs | # spent 54µs (12+42) within Encode::Encoding::BEGIN@5 which was called:
# once (12µs+42µs) by parent::import at line 5 # spent 54µs making 1 call to Encode::Encoding::BEGIN@5
# spent 42µs making 1 call to warnings::import |
6 | 3 | 17µs | 1 | 5µs | our $VERSION = do { my @r = ( q$Revision: 2.8 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; # spent 5µs making 1 call to Encode::Encoding::CORE:match |
7 | |||||
8 | 1 | 1µs | our @CARP_NOT = qw(Encode Encode::Encoder); | ||
9 | |||||
10 | 2 | 16µ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 | 22µs | 1 | 1µs | # spent 1µs within Encode::Encoding::BEGIN@11 which was called:
# once (1µs+0s) by parent::import at line 11 # spent 1µs making 1 call to Encode::Encoding::BEGIN@11 |
12 | 2 | 36µs | 2 | 12µs | # spent 11µs (10+1000ns) within Encode::Encoding::BEGIN@12 which was called:
# once (10µs+1000ns) by parent::import at line 12 # spent 11µs making 1 call to Encode::Encoding::BEGIN@12
# spent 1µs making 1 call to Encode::Encoding::__ANON__ |
13 | |||||
14 | 2 | 388µs | 2 | 143µs | # spent 77µs (11+66) within Encode::Encoding::BEGIN@14 which was called:
# once (11µs+66µs) by parent::import at line 14 # spent 77µs making 1 call to Encode::Encoding::BEGIN@14
# spent 66µ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 6µs within Encode::Encoding::renew which was called:
# once (6µ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 | 4µ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 | 187728 | 262ms | # spent 156ms within Encode::Encoding::renewed which was called 187728 times, avg 832ns/call:
# 187289 times (155ms+0s) by Encode::utf8::decode at line 122 of Mojo/Util.pm, avg 829ns/call
# 439 times (954µs+0s) by Encode::utf8::decode at line 75 of YAML/PP/Reader.pm, avg 2µs/call | ||
40 | |||||
41 | 1 | 1µs | *new_sequence = \&renew; | ||
42 | |||||
43 | 1 | 3µs | # spent 2µs within Encode::Encoding::needs_lines which was called:
# once (2µ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 | 8µs | 1; | ||
73 | __END__ | ||||
# spent 5µs within Encode::Encoding::CORE:match which was called:
# once (5µ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 |