Filename | /usr/lib64/perl5/vendor_perl/Encode/Encoding.pm |
Statements | Executed 1013 statements in 2.94ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
101 | 2 | 2 | 1.24ms | 1.41ms | renew | Encode::Encoding::
296 | 2 | 2 | 376µs | 376µs | renewed | Encode::Encoding::
101 | 1 | 1 | 176µs | 176µs | DEBUG | Encode::Encoding::
101 | 2 | 2 | 137µs | 137µs | needs_lines | Encode::Encoding::
1 | 1 | 1 | 18µs | 37µs | BEGIN@4 | Encode::Encoding::
1 | 1 | 1 | 12µs | 18µs | BEGIN@5 | 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 | 38µs | 2 | 56µs | # spent 37µs (18+19) within Encode::Encoding::BEGIN@4 which was called:
# once (18µs+19µs) by Encode::predefine_encodings at line 4 # spent 37µs making 1 call to Encode::Encoding::BEGIN@4
# spent 19µs making 1 call to strict::import |
5 | 2 | 519µs | 2 | 24µs | # spent 18µs (12+6) within Encode::Encoding::BEGIN@5 which was called:
# once (12µs+6µs) by Encode::predefine_encodings at line 5 # spent 18µs making 1 call to Encode::Encoding::BEGIN@5
# spent 6µs making 1 call to warnings::import |
6 | 3 | 11µs | our $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r }; | ||
7 | |||||
8 | 1 | 600ns | require Encode; | ||
9 | |||||
10 | 101 | 248µs | # spent 176µs within Encode::Encoding::DEBUG which was called 101 times, avg 2µs/call:
# 101 times (176µs+0s) by Encode::Encoding::renew at line 34, avg 2µs/call | ||
11 | |||||
12 | sub Define { | ||||
13 | my $obj = shift; | ||||
14 | my $canonical = shift; | ||||
15 | $obj = bless { Name => $canonical }, $obj unless ref $obj; | ||||
16 | |||||
17 | # warn "$canonical => $obj\n"; | ||||
18 | Encode::define_encoding( $obj, $canonical, @_ ); | ||||
19 | } | ||||
20 | |||||
21 | sub name { return shift->{'Name'} } | ||||
22 | |||||
23 | sub mime_name{ | ||||
24 | require Encode::MIME::Name; | ||||
25 | return Encode::MIME::Name::get_mime_name(shift->name); | ||||
26 | } | ||||
27 | |||||
28 | # sub renew { return $_[0] } | ||||
29 | |||||
30 | # spent 1.41ms (1.24+176µs) within Encode::Encoding::renew which was called 101 times, avg 14µs/call:
# 100 times (1.23ms+175µs) by Foswiki::Templates::_readFile at line 589 of /var/www/foswikidev/core/lib/Foswiki/Templates.pm, avg 14µs/call
# once (8µs+1000ns) by Foswiki::Logger::PlainFile::log at line 136 of /var/www/foswikidev/core/lib/Foswiki/Logger/PlainFile.pm | ||||
31 | 101 | 36µs | my $self = shift; | ||
32 | 101 | 520µs | my $clone = bless {%$self} => ref($self); | ||
33 | 101 | 131µs | $clone->{renewed}++; # so the caller can see it | ||
34 | 101 | 202µs | 101 | 176µs | DEBUG and warn $clone->{renewed}; # spent 176µs making 101 calls to Encode::Encoding::DEBUG, avg 2µs/call |
35 | 101 | 227µs | return $clone; | ||
36 | } | ||||
37 | |||||
38 | 296 | 795µs | # spent 376µs within Encode::Encoding::renewed which was called 296 times, avg 1µs/call:
# 295 times (374µs+0s) by Encode::utf8::decode_xs at line 591 of /var/www/foswikidev/core/lib/Foswiki/Templates.pm, avg 1µs/call
# once (3µs+0s) by Encode::utf8::decode_xs at line 217 of Encode.pm | ||
39 | |||||
40 | 1 | 2µs | *new_sequence = \&renew; | ||
41 | |||||
42 | 101 | 199µs | # spent 137µs within Encode::Encoding::needs_lines which was called 101 times, avg 1µs/call:
# 100 times (136µs+0s) by Foswiki::Templates::_readFile at line 589 of /var/www/foswikidev/core/lib/Foswiki/Templates.pm, avg 1µs/call
# once (700ns+0s) by Foswiki::Logger::PlainFile::log at line 136 of /var/www/foswikidev/core/lib/Foswiki/Logger/PlainFile.pm | ||
43 | |||||
44 | sub perlio_ok { | ||||
45 | eval { require PerlIO::encoding }; | ||||
46 | return $@ ? 0 : 1; | ||||
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 | require Carp; | ||||
60 | my $obj = shift; | ||||
61 | my $class = ref($obj) ? ref($obj) : $obj; | ||||
62 | Carp::croak( $class . "->encode() not defined!" ); | ||||
63 | } | ||||
64 | |||||
65 | sub decode { | ||||
66 | require Carp; | ||||
67 | my $obj = shift; | ||||
68 | my $class = ref($obj) ? ref($obj) : $obj; | ||||
69 | Carp::croak( $class . "->encode() not defined!" ); | ||||
70 | } | ||||
71 | |||||
72 | sub DESTROY { } | ||||
73 | |||||
74 | 1 | 7µs | 1; | ||
75 | __END__ |