← Index
NYTProf Performance Profile   « line view »
For opt.pl
  Run on Fri May 8 15:08:12 2015
Reported on Fri May 8 15:08:16 2015

Filename/home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/Encode/Encoding.pm
StatementsExecuted 700 statements in 1.39ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
5011434µs500µsEncode::Encoding::::renewEncode::Encoding::renew
34011270µs270µsEncode::Encoding::::renewedEncode::Encoding::renewed
501166µs66µsEncode::Encoding::::DEBUGEncode::Encoding::DEBUG
501156µs56µsEncode::Encoding::::needs_linesEncode::Encoding::needs_lines
11111µs24µsEncode::Encoding::::BEGIN@4Encode::Encoding::BEGIN@4
1115µs9µsEncode::Encoding::::BEGIN@5Encode::Encoding::BEGIN@5
1113µs3µsEncode::Encoding::::CORE:matchEncode::Encoding::CORE:match (opcode)
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
4230µs237µs
# spent 24µs (11+13) within Encode::Encoding::BEGIN@4 which was called: # once (11µs+13µs) by Encode::predefine_encodings at line 4
use strict;
# spent 24µs making 1 call to Encode::Encoding::BEGIN@4 # spent 13µs making 1 call to strict::import
52259µs212µs
# spent 9µs (5+4) within Encode::Encoding::BEGIN@5 which was called: # once (5µs+4µs) by Encode::predefine_encodings at line 5
use warnings;
# spent 9µs making 1 call to Encode::Encoding::BEGIN@5 # spent 4µs making 1 call to warnings::import
6314µs13µsour $VERSION = do { my @r = ( q$Revision: 2.7 $ =~ /\d+/g ); sprintf "%d." . "%02d" x $#r, @r };
# spent 3µs making 1 call to Encode::Encoding::CORE:match
7
81500nsrequire Encode;
9
1050102µs
# spent 66µs within Encode::Encoding::DEBUG which was called 50 times, avg 1µs/call: # 50 times (66µs+0s) by Encode::Encoding::renew at line 34, avg 1µ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 500µs (434+66) within Encode::Encoding::renew which was called 50 times, avg 10µs/call: # 50 times (434µs+66µs) by main::CORE:open at line 53 of opt.pl, avg 10µs/call
sub renew {
315016µs my $self = shift;
3250184µs my $clone = bless {%$self} => ref($self);
335044µs $clone->{renewed}++; # so the caller can see it
345080µs5066µs DEBUG and warn $clone->{renewed};
# spent 66µs making 50 calls to Encode::Encoding::DEBUG, avg 1µs/call
355086µs return $clone;
36}
37
38340493µs
# spent 270µs within Encode::Encoding::renewed which was called 340 times, avg 794ns/call: # 340 times (270µs+0s) by Encode::utf8::decode_xs at line 54 of opt.pl, avg 794ns/call
sub renewed { return $_[0]->{renewed} || 0 }
39
401800ns*new_sequence = \&renew;
41
425075µs
# spent 56µs within Encode::Encoding::needs_lines which was called 50 times, avg 1µs/call: # 50 times (56µs+0s) by main::CORE:open at line 53 of opt.pl, avg 1µs/call
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
7414µs1;
75__END__
 
# spent 3µs within Encode::Encoding::CORE:match which was called: # once (3µs+0s) by Encode::predefine_encodings at line 6
sub Encode::Encoding::CORE:match; # opcode