← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 18:42:36 2015
Reported on Fri Jul 31 18:48:13 2015

Filename/usr/lib64/perl5/vendor_perl/Encode/Encoding.pm
StatementsExecuted 1013 statements in 2.94ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
101221.24ms1.41msEncode::Encoding::::renewEncode::Encoding::renew
29622376µs376µsEncode::Encoding::::renewedEncode::Encoding::renewed
10111176µs176µsEncode::Encoding::::DEBUGEncode::Encoding::DEBUG
10122137µs137µsEncode::Encoding::::needs_linesEncode::Encoding::needs_lines
11118µs37µsEncode::Encoding::::BEGIN@4Encode::Encoding::BEGIN@4
11112µs18µsEncode::Encoding::::BEGIN@5Encode::Encoding::BEGIN@5
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
4238µs256µ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
use strict;
# spent 37µs making 1 call to Encode::Encoding::BEGIN@4 # spent 19µs making 1 call to strict::import
52519µs224µ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
use warnings;
# spent 18µs making 1 call to Encode::Encoding::BEGIN@5 # spent 6µs making 1 call to warnings::import
6311µsour $VERSION = do { my @r = ( q$Revision: 2.5 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
7
81600nsrequire Encode;
9
10101248µ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
sub DEBUG { 0 }
11
12sub 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
21sub name { return shift->{'Name'} }
22
23sub 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
sub renew {
3110136µs my $self = shift;
32101520µs my $clone = bless {%$self} => ref($self);
33101131µs $clone->{renewed}++; # so the caller can see it
34101202µs101176µs DEBUG and warn $clone->{renewed};
# spent 176µs making 101 calls to Encode::Encoding::DEBUG, avg 2µs/call
35101227µs return $clone;
36}
37
38296795µ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
sub renewed { return $_[0]->{renewed} || 0 }
39
4012µs*new_sequence = \&renew;
41
42101199µ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
sub needs_lines { 0 }
43
44sub perlio_ok {
45 eval { require PerlIO::encoding };
46 return $@ ? 0 : 1;
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 require Carp;
60 my $obj = shift;
61 my $class = ref($obj) ? ref($obj) : $obj;
62 Carp::croak( $class . "->encode() not defined!" );
63}
64
65sub 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
72sub DESTROY { }
73
7417µs1;
75__END__