← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 16:10:05 2022
Reported on Wed Dec 14 16:12:56 2022

Filename/Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/darwin-2level/Encode/Encoding.pm
StatementsExecuted 183465 statements in 293ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
18344222174ms174msEncode::Encoding::::renewedEncode::Encoding::renewed
11125µs92µsEncode::Encoding::::BEGIN@14Encode::Encoding::BEGIN@14
11123µs26µsEncode::Encoding::::BEGIN@4Encode::Encoding::BEGIN@4
11114µs14µsEncode::Encoding::::CORE:matchEncode::Encoding::CORE:match (opcode)
11112µs13µsEncode::Encoding::::BEGIN@12Encode::Encoding::BEGIN@12
1119µs57µsEncode::Encoding::::BEGIN@5Encode::Encoding::BEGIN@5
1118µs8µsEncode::Encoding::::renewEncode::Encoding::renew
1114µs4µsEncode::Encoding::::BEGIN@10Encode::Encoding::BEGIN@10
1113µs3µsEncode::Encoding::::BEGIN@11Encode::Encoding::BEGIN@11
1111µs1µsEncode::Encoding::::__ANON__Encode::Encoding::__ANON__ (xsub)
1111µs1µsEncode::Encoding::::needs_linesEncode::Encoding::needs_lines
0000s0sEncode::Encoding::::DESTROYEncode::Encoding::DESTROY
0000s0sEncode::Encoding::::DefineEncode::Encoding::Define
0000s0sEncode::Encoding::::decodeEncode::Encoding::decode
0000s0sEncode::Encoding::::encodeEncode::Encoding::encode
0000s0sEncode::Encoding::::fromUnicodeEncode::Encoding::fromUnicode
0000s0sEncode::Encoding::::mime_nameEncode::Encoding::mime_name
0000s0sEncode::Encoding::::nameEncode::Encoding::name
0000s0sEncode::Encoding::::perlio_okEncode::Encoding::perlio_ok
0000s0sEncode::Encoding::::toUnicodeEncode::Encoding::toUnicode
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Encode::Encoding;
2
3# Base class for classes which implement encodings
4234µs229µ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
use strict;
# spent 26µs making 1 call to Encode::Encoding::BEGIN@4 # spent 3µs making 1 call to strict::import
5279µs2105µ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
use warnings;
# spent 57µs making 1 call to Encode::Encoding::BEGIN@5 # spent 48µs making 1 call to warnings::import
6334µs114µsour $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
811µsour @CARP_NOT = qw(Encode Encode::Encoder);
9
10217µs14µs
# spent 4µs within Encode::Encoding::BEGIN@10 which was called: # once (4µs+0s) by parent::import at line 10
use Carp ();
# spent 4µs making 1 call to Encode::Encoding::BEGIN@10
11225µs13µs
# spent 3µs within Encode::Encoding::BEGIN@11 which was called: # once (3µs+0s) by parent::import at line 11
use Encode ();
# spent 3µs making 1 call to Encode::Encoding::BEGIN@11
12272µs214µs
# spent 13µs (12+1000ns) within Encode::Encoding::BEGIN@12 which was called: # once (12µs+1000ns) by parent::import at line 12
use Encode::MIME::Name;
# spent 13µs making 1 call to Encode::Encoding::BEGIN@12 # spent 1µs making 1 call to Encode::Encoding::__ANON__
13
142547µs2159µ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
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
# spent 92µs making 1 call to Encode::Encoding::BEGIN@14 # spent 67µs making 1 call to constant::import
15
16sub 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
25sub name { return shift->{'Name'} }
26
27sub 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
sub renew {
3210s my $self = shift;
3316µs my $clone = bless {%$self} => ref($self);
3411µs $clone->{renewed}++; # so the caller can see it
35 DEBUG and warn $clone->{renewed};
3614µs return $clone;
37}
38
39183442293ms
# 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
sub renewed { return $_[0]->{renewed} || 0 }
40
4113µs*new_sequence = \&renew;
42
4313µ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
sub needs_lines { 0 }
44
45sub perlio_ok {
46 return eval { require PerlIO::encoding } ? 1 : 0;
47}
48
49# (Temporary|legacy) methods
50
51sub toUnicode { shift->decode(@_) }
52sub fromUnicode { shift->encode(@_) }
53
54#
55# Needs to be overloaded or just croak
56#
57
58sub encode {
59 my $obj = shift;
60 my $class = ref($obj) ? ref($obj) : $obj;
61 Carp::croak( $class . "->encode() not defined!" );
62}
63
64sub decode {
65 my $obj = shift;
66 my $class = ref($obj) ? ref($obj) : $obj;
67 Carp::croak( $class . "->encode() not defined!" );
68}
69
70sub DESTROY { }
71
72111µs1;
73__END__
 
# spent 14µs within Encode::Encoding::CORE:match which was called: # once (14µs+0s) by parent::import at line 6
sub Encode::Encoding::CORE:match; # opcode
# spent 1µs within Encode::Encoding::__ANON__ which was called: # once (1µs+0s) by Encode::Encoding::BEGIN@12 at line 12
sub Encode::Encoding::__ANON__; # xsub