← Index
NYTProf Performance Profile   « line view »
For split.pl
  Run on Thu Apr 20 02:05:47 2023
Reported on Thu Apr 20 18:31:10 2023

Filename/home/hejohns/perl5/lib/perl5/x86_64-linux-gnu-thread-multi/Encode/Encoding.pm
StatementsExecuted 135889 statements in 556ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
13534521778ms778msEncode::Encoding::::renewedEncode::Encoding::renewed
105111.57ms1.57msEncode::Encoding::::renewEncode::Encoding::renew
10511227µs227µsEncode::Encoding::::needs_linesEncode::Encoding::needs_lines
1119µs10µsEncode::Encoding::::BEGIN@12Encode::Encoding::BEGIN@12
1119µs11µsEncode::Encoding::::BEGIN@4Encode::Encoding::BEGIN@4
1117µs24µsEncode::Encoding::::BEGIN@5Encode::Encoding::BEGIN@5
1115µs34µsEncode::Encoding::::BEGIN@14Encode::Encoding::BEGIN@14
1112µs2µsEncode::Encoding::::CORE:matchEncode::Encoding::CORE:match (opcode)
1112µs2µsEncode::Encoding::::BEGIN@10Encode::Encoding::BEGIN@10
1111µs1µsEncode::Encoding::::nameEncode::Encoding::name
1111µs1µsEncode::Encoding::::BEGIN@11Encode::Encoding::BEGIN@11
111300ns300nsEncode::Encoding::::__ANON__Encode::Encoding::__ANON__ (xsub)
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::::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
4219µs213µs
# spent 11µs (9+2) within Encode::Encoding::BEGIN@4 which was called: # once (9µs+2µs) by parent::import at line 4
use strict;
# spent 11µs making 1 call to Encode::Encoding::BEGIN@4 # spent 2µs making 1 call to strict::import
5253µs242µs
# spent 24µs (7+17) within Encode::Encoding::BEGIN@5 which was called: # once (7µs+17µs) by parent::import at line 5
use warnings;
# spent 24µs making 1 call to Encode::Encoding::BEGIN@5 # spent 17µs making 1 call to warnings::import
6310µs12µsour $VERSION = do { my @r = ( q$Revision: 2.8 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
# spent 2µs making 1 call to Encode::Encoding::CORE:match
7
81500nsour @CARP_NOT = qw(Encode Encode::Encoder);
9
10211µs12µs
# spent 2µs within Encode::Encoding::BEGIN@10 which was called: # once (2µs+0s) by parent::import at line 10
use Carp ();
# spent 2µs making 1 call to Encode::Encoding::BEGIN@10
11213µs11µs
# spent 1µs within Encode::Encoding::BEGIN@11 which was called: # once (1µs+0s) by parent::import at line 11
use Encode ();
# spent 1µs making 1 call to Encode::Encoding::BEGIN@11
12226µs210µs
# spent 10µs (9+300ns) within Encode::Encoding::BEGIN@12 which was called: # once (9µs+300ns) by parent::import at line 12
use Encode::MIME::Name;
# spent 10µs making 1 call to Encode::Encoding::BEGIN@12 # spent 300ns making 1 call to Encode::Encoding::__ANON__
13
142229µs263µs
# spent 34µs (5+29) within Encode::Encoding::BEGIN@14 which was called: # once (5µs+29µs) by parent::import at line 14
use constant DEBUG => !!$ENV{PERL_ENCODE_DEBUG};
# spent 34µs making 1 call to Encode::Encoding::BEGIN@14 # spent 29µ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
2512µs
# spent 1µs within Encode::Encoding::name which was called: # once (1µs+0s) by IPC::Cmd::can_run at line 15 of ExtUtils/MakeMaker.pm
sub name { return shift->{'Name'} }
26
27sub mime_name {
28 return Encode::MIME::Name::get_mime_name(shift->name);
29}
30
31
# spent 1.57ms within Encode::Encoding::renew which was called 105 times, avg 15µs/call: # 105 times (1.57ms+0s) by Text::CSV_XS::CORE:open at line 1240 of Text/CSV_XS.pm, avg 15µs/call
sub renew {
3210524µs my $self = shift;
33105847µs my $clone = bless {%$self} => ref($self);
3410562µs $clone->{renewed}++; # so the caller can see it
35 DEBUG and warn $clone->{renewed};
36105167µs return $clone;
37}
38
39135345554ms
# spent 778ms within Encode::Encoding::renewed which was called 135345 times, avg 6µs/call: # 135240 times (778ms+0s) by Encode::utf8::decode at line 1047 of Text/CSV_XS.pm, avg 6µs/call # 105 times (129µs+0s) by Encode::utf8::decode at line 1421 of Text/CSV_XS.pm, avg 1µs/call
sub renewed { return $_[0]->{renewed} || 0 }
40
411600ns*new_sequence = \&renew;
42
43105150µs
# spent 227µs within Encode::Encoding::needs_lines which was called 105 times, avg 2µs/call: # 105 times (227µs+0s) by Text::CSV_XS::CORE:open at line 1240 of Text/CSV_XS.pm, avg 2µs/call
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
7215µs1;
73__END__
 
# spent 2µs within Encode::Encoding::CORE:match which was called: # once (2µs+0s) by parent::import at line 6
sub Encode::Encoding::CORE:match; # opcode
# spent 300ns within Encode::Encoding::__ANON__ which was called: # once (300ns+0s) by Encode::Encoding::BEGIN@12 at line 12
sub Encode::Encoding::__ANON__; # xsub