Filename | /usr/local/lib/perl5/5.24/mach/Encode.pm |
Statements | Executed 142 statements in 7.30ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1039 | 1 | 1 | 9.94ms | 9.94ms | encode_xs (xsub) | Encode::utf8::
1 | 1 | 1 | 4.12ms | 8.17ms | BEGIN@47 | Encode::
1 | 1 | 1 | 1.35ms | 1.51ms | predefine_encodings | Encode::
7 | 1 | 1 | 204µs | 1.73ms | getEncoding (recurses: max depth 1, inclusive time 69µs) | Encode::
5 | 1 | 1 | 169µs | 169µs | define_encoding | Encode::
7 | 6 | 3 | 132µs | 1.82ms | find_encoding (recurses: max depth 1, inclusive time 114µs) | Encode::
1 | 1 | 1 | 55µs | 71µs | BEGIN@5 | Encode::
1 | 1 | 1 | 46µs | 108µs | BEGIN@12 | Encode::
1 | 1 | 1 | 38µs | 103µs | BEGIN@268 | Encode::
1 | 1 | 1 | 34µs | 42µs | BEGIN@355 | Encode::utf8::
7 | 1 | 1 | 29µs | 29µs | CORE:subst (opcode) | Encode::
1 | 1 | 1 | 29µs | 32µs | encode_utf8 | Encode::
1 | 1 | 1 | 26µs | 200µs | BEGIN@8 | Encode::
1 | 1 | 1 | 22µs | 65µs | BEGIN@6 | Encode::
1 | 1 | 1 | 14µs | 14µs | CORE:match (opcode) | Encode::
1 | 1 | 1 | 12µs | 12µs | BEGIN@9 | Encode::
0 | 0 | 0 | 0s | 0s | __ANON__[:311] | Encode::Internal::
0 | 0 | 0 | 0s | 0s | __ANON__[:286] | Encode::UTF_EBCDIC::
0 | 0 | 0 | 0s | 0s | __ANON__[:298] | Encode::UTF_EBCDIC::
0 | 0 | 0 | 0s | 0s | __ANON__[:167] | Encode::
0 | 0 | 0 | 0s | 0s | __ANON__[:196] | Encode::
0 | 0 | 0 | 0s | 0s | clone_encoding | Encode::
0 | 0 | 0 | 0s | 0s | decode | Encode::
0 | 0 | 0 | 0s | 0s | decode_utf8 | Encode::
0 | 0 | 0 | 0s | 0s | encode | Encode::
0 | 0 | 0 | 0s | 0s | encodings | Encode::
0 | 0 | 0 | 0s | 0s | from_to | Encode::
0 | 0 | 0 | 0s | 0s | perlio_ok | Encode::
0 | 0 | 0 | 0s | 0s | resolve_alias | Encode::
0 | 0 | 0 | 0s | 0s | __ANON__[:343] | Encode::utf8::
0 | 0 | 0 | 0s | 0s | __ANON__[:349] | Encode::utf8::
0 | 0 | 0 | 0s | 0s | __ANON__[:365] | Encode::utf8::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # | ||||
2 | # $Id: Encode.pm,v 2.80 2016/01/25 14:54:01 dankogai Exp $ | ||||
3 | # | ||||
4 | package Encode; | ||||
5 | 2 | 73µs | 2 | 87µs | # spent 71µs (55+16) within Encode::BEGIN@5 which was called:
# once (55µs+16µs) by Pod::Text::BEGIN@33 at line 5 # spent 71µs making 1 call to Encode::BEGIN@5
# spent 16µs making 1 call to strict::import |
6 | 2 | 135µs | 2 | 109µs | # spent 65µs (22+43) within Encode::BEGIN@6 which was called:
# once (22µs+43µs) by Pod::Text::BEGIN@33 at line 6 # spent 65µs making 1 call to Encode::BEGIN@6
# spent 43µs making 1 call to warnings::import |
7 | 1 | 32µs | 1 | 14µs | our $VERSION = sprintf "%d.%02d_01", q$Revision: 2.80 $ =~ /(\d+)/g; # spent 14µs making 1 call to Encode::CORE:match |
8 | 2 | 71µs | 2 | 374µs | # spent 200µs (26+174) within Encode::BEGIN@8 which was called:
# once (26µs+174µs) by Pod::Text::BEGIN@33 at line 8 # spent 200µs making 1 call to Encode::BEGIN@8
# spent 174µs making 1 call to constant::import |
9 | 2 | 97µs | 1 | 12µs | # spent 12µs within Encode::BEGIN@9 which was called:
# once (12µs+0s) by Pod::Text::BEGIN@33 at line 9 # spent 12µs making 1 call to Encode::BEGIN@9 |
10 | 1 | 429µs | 1 | 643µs | XSLoader::load( __PACKAGE__, $VERSION ); # spent 643µs making 1 call to XSLoader::load |
11 | |||||
12 | 3 | 378µs | 3 | 170µs | # spent 108µs (46+62) within Encode::BEGIN@12 which was called:
# once (46µs+62µs) by Pod::Text::BEGIN@33 at line 12 # spent 108µs making 1 call to Encode::BEGIN@12
# spent 39µs making 1 call to Exporter::import
# spent 23µs making 1 call to UNIVERSAL::VERSION |
13 | |||||
14 | # Public, encouraged API is exported by default | ||||
15 | |||||
16 | 1 | 8µs | our @EXPORT = qw( | ||
17 | decode decode_utf8 encode encode_utf8 str2bytes bytes2str | ||||
18 | encodings find_encoding clone_encoding | ||||
19 | ); | ||||
20 | 1 | 4µs | our @FB_FLAGS = qw( | ||
21 | DIE_ON_ERR WARN_ON_ERR RETURN_ON_ERR LEAVE_SRC | ||||
22 | PERLQQ HTMLCREF XMLCREF STOP_AT_PARTIAL | ||||
23 | ); | ||||
24 | 1 | 3µs | our @FB_CONSTS = qw( | ||
25 | FB_DEFAULT FB_CROAK FB_QUIET FB_WARN | ||||
26 | FB_PERLQQ FB_HTMLCREF FB_XMLCREF | ||||
27 | ); | ||||
28 | 1 | 6µs | our @EXPORT_OK = ( | ||
29 | qw( | ||||
30 | _utf8_off _utf8_on define_encoding from_to is_16bit is_8bit | ||||
31 | is_utf8 perlio_ok resolve_alias utf8_downgrade utf8_upgrade | ||||
32 | ), | ||||
33 | @FB_FLAGS, @FB_CONSTS, | ||||
34 | ); | ||||
35 | |||||
36 | 1 | 17µs | our %EXPORT_TAGS = ( | ||
37 | all => [ @EXPORT, @EXPORT_OK ], | ||||
38 | default => [ @EXPORT ], | ||||
39 | fallbacks => [ @FB_CONSTS ], | ||||
40 | fallback_all => [ @FB_CONSTS, @FB_FLAGS ], | ||||
41 | ); | ||||
42 | |||||
43 | # Documentation moved after __END__ for speed - NI-S | ||||
44 | |||||
45 | 1 | 6µs | our $ON_EBCDIC = ( ord("A") == 193 ); | ||
46 | |||||
47 | 2 | 2.99ms | 2 | 8.34ms | # spent 8.17ms (4.12+4.05) within Encode::BEGIN@47 which was called:
# once (4.12ms+4.05ms) by Pod::Text::BEGIN@33 at line 47 # spent 8.17ms making 1 call to Encode::BEGIN@47
# spent 176µs making 1 call to Exporter::import |
48 | |||||
49 | # Make a %Encoding package variable to allow a certain amount of cheating | ||||
50 | our %Encoding; | ||||
51 | our %ExtModule; | ||||
52 | 1 | 350µs | require Encode::Config; | ||
53 | # See | ||||
54 | # https://bugzilla.redhat.com/show_bug.cgi?id=435505#c2 | ||||
55 | # to find why sig handlers inside eval{} are disabled. | ||||
56 | 1 | 2µs | eval { | ||
57 | 1 | 5µs | local $SIG{__DIE__}; | ||
58 | 1 | 3µs | local $SIG{__WARN__}; | ||
59 | 1 | 16µs | local @INC = @INC; | ||
60 | 1 | 2µs | pop @INC if $INC[-1] eq '.'; | ||
61 | 1 | 156µs | require Encode::ConfigLocal; | ||
62 | }; | ||||
63 | |||||
64 | sub encodings { | ||||
65 | my %enc; | ||||
66 | my $arg = $_[1] || ''; | ||||
67 | if ( $arg eq ":all" ) { | ||||
68 | %enc = ( %Encoding, %ExtModule ); | ||||
69 | } | ||||
70 | else { | ||||
71 | %enc = %Encoding; | ||||
72 | for my $mod ( map { m/::/ ? $_ : "Encode::$_" } @_ ) { | ||||
73 | DEBUG and warn $mod; | ||||
74 | for my $enc ( keys %ExtModule ) { | ||||
75 | $ExtModule{$enc} eq $mod and $enc{$enc} = $mod; | ||||
76 | } | ||||
77 | } | ||||
78 | } | ||||
79 | return sort { lc $a cmp lc $b } | ||||
80 | grep { !/^(?:Internal|Unicode|Guess)$/o } keys %enc; | ||||
81 | } | ||||
82 | |||||
83 | sub perlio_ok { | ||||
84 | my $obj = ref( $_[0] ) ? $_[0] : find_encoding( $_[0] ); | ||||
85 | $obj->can("perlio_ok") and return $obj->perlio_ok(); | ||||
86 | return 0; # safety net | ||||
87 | } | ||||
88 | |||||
89 | # spent 169µs within Encode::define_encoding which was called 5 times, avg 34µs/call:
# 5 times (169µs+0s) by XSLoader::load at line 114 of XSLoader.pm, avg 34µs/call | ||||
90 | 5 | 10µs | my $obj = shift; | ||
91 | 5 | 10µs | my $name = shift; | ||
92 | 5 | 38µs | $Encoding{$name} = $obj; | ||
93 | 5 | 12µs | my $lc = lc($name); | ||
94 | 5 | 20µs | define_alias( $lc => $obj ) unless $lc eq $name; | ||
95 | 5 | 20µs | while (@_) { | ||
96 | my $alias = shift; | ||||
97 | define_alias( $alias, $obj ); | ||||
98 | } | ||||
99 | 5 | 62µs | return $obj; | ||
100 | } | ||||
101 | |||||
102 | # spent 1.73ms (204µs+1.53) within Encode::getEncoding which was called 7 times, avg 247µs/call:
# 7 times (204µs+1.53ms) by Encode::find_encoding at line 130, avg 247µs/call | ||||
103 | 7 | 16µs | my ( $class, $name, $skip_external ) = @_; | ||
104 | |||||
105 | 7 | 87µs | 7 | 29µs | $name =~ s/\s+//g; # https://rt.cpan.org/Ticket/Display.html?id=65796 # spent 29µs making 7 calls to Encode::CORE:subst, avg 4µs/call |
106 | |||||
107 | 7 | 13µs | ref($name) && $name->can('renew') and return $name; | ||
108 | 7 | 67µs | exists $Encoding{$name} and return $Encoding{$name}; | ||
109 | 2 | 7µs | my $lc = lc $name; | ||
110 | 2 | 4µs | exists $Encoding{$lc} and return $Encoding{$lc}; | ||
111 | |||||
112 | 2 | 16µs | 2 | 1.56ms | my $oc = $class->find_alias($name); # spent 1.56ms making 2 calls to Encode::Alias::find_alias, avg 782µs/call |
113 | 2 | 12µs | defined($oc) and return $oc; | ||
114 | $lc ne $name and $oc = $class->find_alias($lc); | ||||
115 | defined($oc) and return $oc; | ||||
116 | |||||
117 | unless ($skip_external) { | ||||
118 | if ( my $mod = $ExtModule{$name} || $ExtModule{$lc} ) { | ||||
119 | $mod =~ s,::,/,g; | ||||
120 | $mod .= '.pm'; | ||||
121 | eval { require $mod; }; | ||||
122 | exists $Encoding{$name} and return $Encoding{$name}; | ||||
123 | } | ||||
124 | } | ||||
125 | return; | ||||
126 | } | ||||
127 | |||||
128 | # spent 1.82ms (132µs+1.68) within Encode::find_encoding which was called 7 times, avg 260µs/call:
# 2 times (45µs+-45µs) by Encode::Alias::find_alias at line 46 of Encode/Alias.pm, avg 0s/call
# once (11µs+1.34ms) by Mail::SpamAssassin::Message::Node::BEGIN@49 at line 52 of Mail/SpamAssassin/Message/Node.pm
# once (21µs+325µs) by Mail::SpamAssassin::Message::Node::BEGIN@49 at line 51 of Mail/SpamAssassin/Message/Node.pm
# once (20µs+27µs) by Net::DNS::RR::BEGIN@42 at line 59 of Net/DNS/Domain.pm
# once (21µs+25µs) by Net::DNS::Domain::BEGIN@44 at line 46 of Net/DNS/Domain.pm
# once (14µs+17µs) by Net::DNS::RR::BEGIN@42 at line 60 of Net/DNS/Domain.pm | ||||
129 | 7 | 18µs | my ( $name, $skip_external ) = @_; | ||
130 | 7 | 118µs | 7 | 1.73ms | return __PACKAGE__->getEncoding( $name, $skip_external ); # spent 1.80ms making 7 calls to Encode::getEncoding, avg 257µs/call, recursion: max depth 1, sum of overlapping time 69µs |
131 | } | ||||
132 | |||||
133 | sub resolve_alias($) { | ||||
134 | my $obj = find_encoding(shift); | ||||
135 | defined $obj and return $obj->name; | ||||
136 | return; | ||||
137 | } | ||||
138 | |||||
139 | sub clone_encoding($) { | ||||
140 | my $obj = find_encoding(shift); | ||||
141 | ref $obj or return; | ||||
142 | eval { require Storable }; | ||||
143 | $@ and return; | ||||
144 | return Storable::dclone($obj); | ||||
145 | } | ||||
146 | |||||
147 | sub encode($$;$) { | ||||
148 | my ( $name, $string, $check ) = @_; | ||||
149 | return undef unless defined $string; | ||||
150 | $string .= ''; # stringify; | ||||
151 | $check ||= 0; | ||||
152 | unless ( defined $name ) { | ||||
153 | require Carp; | ||||
154 | Carp::croak("Encoding name should not be undef"); | ||||
155 | } | ||||
156 | my $enc = find_encoding($name); | ||||
157 | unless ( defined $enc ) { | ||||
158 | require Carp; | ||||
159 | Carp::croak("Unknown encoding '$name'"); | ||||
160 | } | ||||
161 | # For Unicode, warnings need to be caught and re-issued at this level | ||||
162 | # so that callers can disable utf8 warnings lexically. | ||||
163 | my $octets; | ||||
164 | if ( ref($enc) eq 'Encode::Unicode' ) { | ||||
165 | my $warn = ''; | ||||
166 | { | ||||
167 | local $SIG{__WARN__} = sub { $warn = shift }; | ||||
168 | $octets = $enc->encode( $string, $check ); | ||||
169 | } | ||||
170 | warnings::warnif('utf8', $warn) if length $warn; | ||||
171 | } | ||||
172 | else { | ||||
173 | $octets = $enc->encode( $string, $check ); | ||||
174 | } | ||||
175 | $_[1] = $string if $check and !ref $check and !( $check & LEAVE_SRC() ); | ||||
176 | return $octets; | ||||
177 | } | ||||
178 | 1 | 7µs | *str2bytes = \&encode; | ||
179 | |||||
180 | sub decode($$;$) { | ||||
181 | my ( $name, $octets, $check ) = @_; | ||||
182 | return undef unless defined $octets; | ||||
183 | $octets .= ''; | ||||
184 | $check ||= 0; | ||||
185 | my $enc = find_encoding($name); | ||||
186 | unless ( defined $enc ) { | ||||
187 | require Carp; | ||||
188 | Carp::croak("Unknown encoding '$name'"); | ||||
189 | } | ||||
190 | # For Unicode, warnings need to be caught and re-issued at this level | ||||
191 | # so that callers can disable utf8 warnings lexically. | ||||
192 | my $string; | ||||
193 | if ( ref($enc) eq 'Encode::Unicode' ) { | ||||
194 | my $warn = ''; | ||||
195 | { | ||||
196 | local $SIG{__WARN__} = sub { $warn = shift }; | ||||
197 | $string = $enc->decode( $octets, $check ); | ||||
198 | } | ||||
199 | warnings::warnif('utf8', $warn) if length $warn; | ||||
200 | } | ||||
201 | else { | ||||
202 | $string = $enc->decode( $octets, $check ); | ||||
203 | } | ||||
204 | $_[1] = $octets if $check and !ref $check and !( $check & LEAVE_SRC() ); | ||||
205 | return $string; | ||||
206 | } | ||||
207 | 1 | 2µs | *bytes2str = \&decode; | ||
208 | |||||
209 | sub from_to($$$;$) { | ||||
210 | my ( $string, $from, $to, $check ) = @_; | ||||
211 | return undef unless defined $string; | ||||
212 | $check ||= 0; | ||||
213 | my $f = find_encoding($from); | ||||
214 | unless ( defined $f ) { | ||||
215 | require Carp; | ||||
216 | Carp::croak("Unknown encoding '$from'"); | ||||
217 | } | ||||
218 | my $t = find_encoding($to); | ||||
219 | unless ( defined $t ) { | ||||
220 | require Carp; | ||||
221 | Carp::croak("Unknown encoding '$to'"); | ||||
222 | } | ||||
223 | my $uni = $f->decode($string); | ||||
224 | $_[0] = $string = $t->encode( $uni, $check ); | ||||
225 | return undef if ( $check && length($uni) ); | ||||
226 | return defined( $_[0] ) ? length($string) : undef; | ||||
227 | } | ||||
228 | |||||
229 | # spent 32µs (29+3) within Encode::encode_utf8 which was called:
# once (29µs+3µs) by Net::DNS::Domain::BEGIN@49 at line 50 of Net/DNS/Domain.pm | ||||
230 | 1 | 3µs | my ($str) = @_; | ||
231 | 1 | 13µs | 1 | 3µs | utf8::encode($str); # spent 3µs making 1 call to utf8::encode |
232 | 1 | 10µs | return $str; | ||
233 | } | ||||
234 | |||||
235 | 1 | 1µs | my $utf8enc; | ||
236 | |||||
237 | sub decode_utf8($;$) { | ||||
238 | my ( $octets, $check ) = @_; | ||||
239 | return undef unless defined $octets; | ||||
240 | $octets .= ''; | ||||
241 | $check ||= 0; | ||||
242 | $utf8enc ||= find_encoding('utf8'); | ||||
243 | my $string = $utf8enc->decode( $octets, $check ); | ||||
244 | $_[0] = $octets if $check and !ref $check and !( $check & LEAVE_SRC() ); | ||||
245 | return $string; | ||||
246 | } | ||||
247 | |||||
248 | # sub decode_utf8($;$) { | ||||
249 | # my ( $str, $check ) = @_; | ||||
250 | # return $str if is_utf8($str); | ||||
251 | # if ($check) { | ||||
252 | # return decode( "utf8", $str, $check ); | ||||
253 | # } | ||||
254 | # else { | ||||
255 | # return decode( "utf8", $str ); | ||||
256 | # return $str; | ||||
257 | # } | ||||
258 | # } | ||||
259 | |||||
260 | 1 | 7µs | 1 | 1.51ms | predefine_encodings(1); # spent 1.51ms making 1 call to Encode::predefine_encodings |
261 | |||||
262 | # | ||||
263 | # This is to restore %Encoding if really needed; | ||||
264 | # | ||||
265 | |||||
266 | # spent 1.51ms (1.35+153µs) within Encode::predefine_encodings which was called:
# once (1.35ms+153µs) by Pod::Text::BEGIN@33 at line 260 | ||||
267 | 1 | 263µs | require Encode::Encoding; | ||
268 | 2 | 1.12ms | 2 | 169µs | # spent 103µs (38+65) within Encode::BEGIN@268 which was called:
# once (38µs+65µs) by Pod::Text::BEGIN@33 at line 268 # spent 103µs making 1 call to Encode::BEGIN@268
# spent 65µs making 1 call to warnings::unimport |
269 | 1 | 2µs | my $use_xs = shift; | ||
270 | 1 | 4µs | if ($ON_EBCDIC) { | ||
271 | |||||
272 | # was in Encode::UTF_EBCDIC | ||||
273 | package Encode::UTF_EBCDIC; | ||||
274 | push @Encode::UTF_EBCDIC::ISA, 'Encode::Encoding'; | ||||
275 | *decode = sub { | ||||
276 | my ( undef, $str, $chk ) = @_; | ||||
277 | my $res = ''; | ||||
278 | for ( my $i = 0 ; $i < length($str) ; $i++ ) { | ||||
279 | $res .= | ||||
280 | chr( | ||||
281 | utf8::unicode_to_native( ord( substr( $str, $i, 1 ) ) ) | ||||
282 | ); | ||||
283 | } | ||||
284 | $_[1] = '' if $chk; | ||||
285 | return $res; | ||||
286 | }; | ||||
287 | *encode = sub { | ||||
288 | my ( undef, $str, $chk ) = @_; | ||||
289 | my $res = ''; | ||||
290 | for ( my $i = 0 ; $i < length($str) ; $i++ ) { | ||||
291 | $res .= | ||||
292 | chr( | ||||
293 | utf8::native_to_unicode( ord( substr( $str, $i, 1 ) ) ) | ||||
294 | ); | ||||
295 | } | ||||
296 | $_[1] = '' if $chk; | ||||
297 | return $res; | ||||
298 | }; | ||||
299 | $Encode::Encoding{Unicode} = | ||||
300 | bless { Name => "UTF_EBCDIC" } => "Encode::UTF_EBCDIC"; | ||||
301 | } | ||||
302 | else { | ||||
303 | |||||
304 | package Encode::Internal; | ||||
305 | 1 | 20µs | push @Encode::Internal::ISA, 'Encode::Encoding'; | ||
306 | *decode = sub { | ||||
307 | my ( undef, $str, $chk ) = @_; | ||||
308 | utf8::upgrade($str); | ||||
309 | $_[1] = '' if $chk; | ||||
310 | return $str; | ||||
311 | 1 | 7µs | }; | ||
312 | 1 | 2µs | *encode = \&decode; | ||
313 | $Encode::Encoding{Unicode} = | ||||
314 | 1 | 10µs | bless { Name => "Internal" } => "Encode::Internal"; | ||
315 | } | ||||
316 | { | ||||
317 | # https://rt.cpan.org/Public/Bug/Display.html?id=103253 | ||||
318 | package Encode::XS; | ||||
319 | 1 | 12µs | push @Encode::XS::ISA, 'Encode::Encoding'; | ||
320 | } | ||||
321 | { | ||||
322 | |||||
323 | # was in Encode::utf8 | ||||
324 | 2 | 18µs | package Encode::utf8; | ||
325 | 1 | 18µs | push @Encode::utf8::ISA, 'Encode::Encoding'; | ||
326 | |||||
327 | # | ||||
328 | 1 | 3µs | if ($use_xs) { | ||
329 | Encode::DEBUG and warn __PACKAGE__, " XS on"; | ||||
330 | 1 | 2µs | *decode = \&decode_xs; | ||
331 | 1 | 2µs | *encode = \&encode_xs; | ||
332 | } | ||||
333 | else { | ||||
334 | Encode::DEBUG and warn __PACKAGE__, " XS off"; | ||||
335 | *decode = sub { | ||||
336 | my ( undef, $octets, $chk ) = @_; | ||||
337 | my $str = Encode::decode_utf8($octets); | ||||
338 | if ( defined $str ) { | ||||
339 | $_[1] = '' if $chk; | ||||
340 | return $str; | ||||
341 | } | ||||
342 | return undef; | ||||
343 | }; | ||||
344 | *encode = sub { | ||||
345 | my ( undef, $string, $chk ) = @_; | ||||
346 | my $octets = Encode::encode_utf8($string); | ||||
347 | $_[1] = '' if $chk; | ||||
348 | return $octets; | ||||
349 | }; | ||||
350 | } | ||||
351 | *cat_decode = sub { # ($obj, $dst, $src, $pos, $trm, $chk) | ||||
352 | # currently ignores $chk | ||||
353 | my ( undef, undef, undef, $pos, $trm ) = @_; | ||||
354 | my ( $rdst, $rsrc, $rpos ) = \@_[ 1, 2, 3 ]; | ||||
355 | 2 | 371µs | 2 | 50µs | # spent 42µs (34+8) within Encode::utf8::BEGIN@355 which was called:
# once (34µs+8µs) by Pod::Text::BEGIN@33 at line 355 # spent 42µs making 1 call to Encode::utf8::BEGIN@355
# spent 8µs making 1 call to bytes::import |
356 | if ( ( my $npos = index( $$rsrc, $trm, $pos ) ) >= 0 ) { | ||||
357 | $$rdst .= | ||||
358 | substr( $$rsrc, $pos, $npos - $pos + length($trm) ); | ||||
359 | $$rpos = $npos + length($trm); | ||||
360 | return 1; | ||||
361 | } | ||||
362 | $$rdst .= substr( $$rsrc, $pos ); | ||||
363 | $$rpos = length($$rsrc); | ||||
364 | return ''; | ||||
365 | 1 | 14µs | }; | ||
366 | $Encode::Encoding{utf8} = | ||||
367 | 1 | 15µs | bless { Name => "utf8" } => "Encode::utf8"; | ||
368 | 1 | 4µs | $Encode::Encoding{"utf-8-strict"} = | ||
369 | bless { Name => "utf-8-strict", strict_utf8 => 1 } | ||||
370 | => "Encode::utf8"; | ||||
371 | } | ||||
372 | } | ||||
373 | |||||
374 | 1 | 46µs | 1; | ||
375 | |||||
376 | __END__ | ||||
# spent 14µs within Encode::CORE:match which was called:
# once (14µs+0s) by Pod::Text::BEGIN@33 at line 7 | |||||
# spent 29µs within Encode::CORE:subst which was called 7 times, avg 4µs/call:
# 7 times (29µs+0s) by Encode::getEncoding at line 105, avg 4µs/call | |||||
# spent 9.94ms within Encode::utf8::encode_xs which was called 1039 times, avg 10µs/call:
# 1039 times (9.94ms+0s) by Net::DNS::Domain::_encode_utf8 at line 312 of Net/DNS/Domain.pm, avg 10µs/call |