| Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/x86_64-linux/Encode.pm |
| Statements | Executed 78 statements in 1.93ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.19ms | 1.53ms | Encode::BEGIN@47 |
| 1 | 1 | 1 | 340µs | 363µs | Encode::predefine_encodings |
| 4 | 1 | 1 | 11µs | 11µs | Encode::define_encoding |
| 1 | 1 | 1 | 11µs | 23µs | Encode::BEGIN@12 |
| 1 | 1 | 1 | 10µs | 12µs | Encode::BEGIN@5 |
| 1 | 1 | 1 | 10µs | 12µs | Encode::utf8::BEGIN@349 |
| 1 | 1 | 1 | 7µs | 16µs | Encode::BEGIN@266 |
| 1 | 1 | 1 | 7µs | 45µs | Encode::BEGIN@8 |
| 1 | 1 | 1 | 5µs | 8µs | Encode::BEGIN@6 |
| 1 | 1 | 1 | 3µs | 3µs | Encode::BEGIN@9 |
| 1 | 1 | 1 | 3µs | 3µs | Encode::CORE:match (opcode) |
| 0 | 0 | 0 | 0s | 0s | Encode::Internal::__ANON__[:309] |
| 0 | 0 | 0 | 0s | 0s | Encode::UTF_EBCDIC::__ANON__[:284] |
| 0 | 0 | 0 | 0s | 0s | Encode::UTF_EBCDIC::__ANON__[:296] |
| 0 | 0 | 0 | 0s | 0s | Encode::__ANON__[:165] |
| 0 | 0 | 0 | 0s | 0s | Encode::__ANON__[:194] |
| 0 | 0 | 0 | 0s | 0s | Encode::clone_encoding |
| 0 | 0 | 0 | 0s | 0s | Encode::decode |
| 0 | 0 | 0 | 0s | 0s | Encode::decode_utf8 |
| 0 | 0 | 0 | 0s | 0s | Encode::encode |
| 0 | 0 | 0 | 0s | 0s | Encode::encode_utf8 |
| 0 | 0 | 0 | 0s | 0s | Encode::encodings |
| 0 | 0 | 0 | 0s | 0s | Encode::find_encoding |
| 0 | 0 | 0 | 0s | 0s | Encode::from_to |
| 0 | 0 | 0 | 0s | 0s | Encode::getEncoding |
| 0 | 0 | 0 | 0s | 0s | Encode::perlio_ok |
| 0 | 0 | 0 | 0s | 0s | Encode::resolve_alias |
| 0 | 0 | 0 | 0s | 0s | Encode::utf8::__ANON__[:337] |
| 0 | 0 | 0 | 0s | 0s | Encode::utf8::__ANON__[:343] |
| 0 | 0 | 0 | 0s | 0s | Encode::utf8::__ANON__[:359] |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # | ||||
| 2 | # $Id: Encode.pm,v 2.72 2015/03/14 02:43:24 dankogai Exp $ | ||||
| 3 | # | ||||
| 4 | package Encode; | ||||
| 5 | 2 | 18µs | 2 | 14µs | # spent 12µs (10+2) within Encode::BEGIN@5 which was called:
# once (10µs+2µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 5 # spent 12µs making 1 call to Encode::BEGIN@5
# spent 2µs making 1 call to strict::import |
| 6 | 2 | 51µs | 2 | 12µs | # spent 8µs (5+3) within Encode::BEGIN@6 which was called:
# once (5µs+3µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 6 # spent 8µs making 1 call to Encode::BEGIN@6
# spent 3µs making 1 call to warnings::import |
| 7 | 1 | 9µs | 1 | 3µs | our $VERSION = sprintf "%d.%02d", q$Revision: 2.72 $ =~ /(\d+)/g; # spent 3µs making 1 call to Encode::CORE:match |
| 8 | 2 | 25µs | 2 | 84µs | # spent 45µs (7+38) within Encode::BEGIN@8 which was called:
# once (7µs+38µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 8 # spent 45µs making 1 call to Encode::BEGIN@8
# spent 38µs making 1 call to constant::import |
| 9 | 2 | 29µs | 1 | 3µs | # spent 3µs within Encode::BEGIN@9 which was called:
# once (3µs+0s) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 9 # spent 3µs making 1 call to Encode::BEGIN@9 |
| 10 | 1 | 158µs | 1 | 179µs | XSLoader::load( __PACKAGE__, $VERSION ); # spent 179µs making 1 call to XSLoader::load |
| 11 | |||||
| 12 | 3 | 126µs | 3 | 36µs | # spent 23µs (11+12) within Encode::BEGIN@12 which was called:
# once (11µs+12µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 12 # spent 23µs making 1 call to Encode::BEGIN@12
# spent 7µs making 1 call to UNIVERSAL::VERSION
# spent 6µs making 1 call to Exporter::import |
| 13 | |||||
| 14 | # Public, encouraged API is exported by default | ||||
| 15 | |||||
| 16 | 1 | 2µs | our @EXPORT = qw( | ||
| 17 | decode decode_utf8 encode encode_utf8 str2bytes bytes2str | ||||
| 18 | encodings find_encoding clone_encoding | ||||
| 19 | ); | ||||
| 20 | 1 | 900ns | 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 | 1µs | our @FB_CONSTS = qw( | ||
| 25 | FB_DEFAULT FB_CROAK FB_QUIET FB_WARN | ||||
| 26 | FB_PERLQQ FB_HTMLCREF FB_XMLCREF | ||||
| 27 | ); | ||||
| 28 | 1 | 2µ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 | 8µ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 | 600ns | our $ON_EBCDIC = ( ord("A") == 193 ); | ||
| 46 | |||||
| 47 | 2 | 824µs | 2 | 1.55ms | # spent 1.53ms (1.19+343µs) within Encode::BEGIN@47 which was called:
# once (1.19ms+343µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 47 # spent 1.53ms making 1 call to Encode::BEGIN@47
# spent 25µ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 | 128µ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 | 300ns | eval { | ||
| 57 | 1 | 2µs | local $SIG{__DIE__}; | ||
| 58 | 1 | 800ns | local $SIG{__WARN__}; | ||
| 59 | 1 | 21µs | require Encode::ConfigLocal; | ||
| 60 | }; | ||||
| 61 | |||||
| 62 | sub encodings { | ||||
| 63 | my %enc; | ||||
| 64 | my $arg = $_[1] || ''; | ||||
| 65 | if ( $arg eq ":all" ) { | ||||
| 66 | %enc = ( %Encoding, %ExtModule ); | ||||
| 67 | } | ||||
| 68 | else { | ||||
| 69 | %enc = %Encoding; | ||||
| 70 | for my $mod ( map { m/::/ ? $_ : "Encode::$_" } @_ ) { | ||||
| 71 | DEBUG and warn $mod; | ||||
| 72 | for my $enc ( keys %ExtModule ) { | ||||
| 73 | $ExtModule{$enc} eq $mod and $enc{$enc} = $mod; | ||||
| 74 | } | ||||
| 75 | } | ||||
| 76 | } | ||||
| 77 | return sort { lc $a cmp lc $b } | ||||
| 78 | grep { !/^(?:Internal|Unicode|Guess)$/o } keys %enc; | ||||
| 79 | } | ||||
| 80 | |||||
| 81 | sub perlio_ok { | ||||
| 82 | my $obj = ref( $_[0] ) ? $_[0] : find_encoding( $_[0] ); | ||||
| 83 | $obj->can("perlio_ok") and return $obj->perlio_ok(); | ||||
| 84 | return 0; # safety net | ||||
| 85 | } | ||||
| 86 | |||||
| 87 | # spent 11µs within Encode::define_encoding which was called 4 times, avg 3µs/call:
# 4 times (11µs+0s) by XSLoader::load at line 94 of XSLoader.pm, avg 3µs/call | ||||
| 88 | 4 | 700ns | my $obj = shift; | ||
| 89 | 4 | 700ns | my $name = shift; | ||
| 90 | 4 | 3µs | $Encoding{$name} = $obj; | ||
| 91 | 4 | 1µs | my $lc = lc($name); | ||
| 92 | 4 | 700ns | define_alias( $lc => $obj ) unless $lc eq $name; | ||
| 93 | 4 | 1µs | while (@_) { | ||
| 94 | my $alias = shift; | ||||
| 95 | define_alias( $alias, $obj ); | ||||
| 96 | } | ||||
| 97 | 4 | 8µs | return $obj; | ||
| 98 | } | ||||
| 99 | |||||
| 100 | sub getEncoding { | ||||
| 101 | my ( $class, $name, $skip_external ) = @_; | ||||
| 102 | |||||
| 103 | $name =~ s/\s+//g; # https://rt.cpan.org/Ticket/Display.html?id=65796 | ||||
| 104 | |||||
| 105 | ref($name) && $name->can('renew') and return $name; | ||||
| 106 | exists $Encoding{$name} and return $Encoding{$name}; | ||||
| 107 | my $lc = lc $name; | ||||
| 108 | exists $Encoding{$lc} and return $Encoding{$lc}; | ||||
| 109 | |||||
| 110 | my $oc = $class->find_alias($name); | ||||
| 111 | defined($oc) and return $oc; | ||||
| 112 | $lc ne $name and $oc = $class->find_alias($lc); | ||||
| 113 | defined($oc) and return $oc; | ||||
| 114 | |||||
| 115 | unless ($skip_external) { | ||||
| 116 | if ( my $mod = $ExtModule{$name} || $ExtModule{$lc} ) { | ||||
| 117 | $mod =~ s,::,/,g; | ||||
| 118 | $mod .= '.pm'; | ||||
| 119 | eval { require $mod; }; | ||||
| 120 | exists $Encoding{$name} and return $Encoding{$name}; | ||||
| 121 | } | ||||
| 122 | } | ||||
| 123 | return; | ||||
| 124 | } | ||||
| 125 | |||||
| 126 | sub find_encoding($;$) { | ||||
| 127 | my ( $name, $skip_external ) = @_; | ||||
| 128 | return __PACKAGE__->getEncoding( $name, $skip_external ); | ||||
| 129 | } | ||||
| 130 | |||||
| 131 | sub resolve_alias($) { | ||||
| 132 | my $obj = find_encoding(shift); | ||||
| 133 | defined $obj and return $obj->name; | ||||
| 134 | return; | ||||
| 135 | } | ||||
| 136 | |||||
| 137 | sub clone_encoding($) { | ||||
| 138 | my $obj = find_encoding(shift); | ||||
| 139 | ref $obj or return; | ||||
| 140 | eval { require Storable }; | ||||
| 141 | $@ and return; | ||||
| 142 | return Storable::dclone($obj); | ||||
| 143 | } | ||||
| 144 | |||||
| 145 | sub encode($$;$) { | ||||
| 146 | my ( $name, $string, $check ) = @_; | ||||
| 147 | return undef unless defined $string; | ||||
| 148 | $string .= ''; # stringify; | ||||
| 149 | $check ||= 0; | ||||
| 150 | unless ( defined $name ) { | ||||
| 151 | require Carp; | ||||
| 152 | Carp::croak("Encoding name should not be undef"); | ||||
| 153 | } | ||||
| 154 | my $enc = find_encoding($name); | ||||
| 155 | unless ( defined $enc ) { | ||||
| 156 | require Carp; | ||||
| 157 | Carp::croak("Unknown encoding '$name'"); | ||||
| 158 | } | ||||
| 159 | # For Unicode, warnings need to be caught and re-issued at this level | ||||
| 160 | # so that callers can disable utf8 warnings lexically. | ||||
| 161 | my $octets; | ||||
| 162 | if ( ref($enc) eq 'Encode::Unicode' ) { | ||||
| 163 | my $warn = ''; | ||||
| 164 | { | ||||
| 165 | local $SIG{__WARN__} = sub { $warn = shift }; | ||||
| 166 | $octets = $enc->encode( $string, $check ); | ||||
| 167 | } | ||||
| 168 | warnings::warnif('utf8', $warn) if length $warn; | ||||
| 169 | } | ||||
| 170 | else { | ||||
| 171 | $octets = $enc->encode( $string, $check ); | ||||
| 172 | } | ||||
| 173 | $_[1] = $string if $check and !ref $check and !( $check & LEAVE_SRC() ); | ||||
| 174 | return $octets; | ||||
| 175 | } | ||||
| 176 | 1 | 2µs | *str2bytes = \&encode; | ||
| 177 | |||||
| 178 | sub decode($$;$) { | ||||
| 179 | my ( $name, $octets, $check ) = @_; | ||||
| 180 | return undef unless defined $octets; | ||||
| 181 | $octets .= ''; | ||||
| 182 | $check ||= 0; | ||||
| 183 | my $enc = find_encoding($name); | ||||
| 184 | unless ( defined $enc ) { | ||||
| 185 | require Carp; | ||||
| 186 | Carp::croak("Unknown encoding '$name'"); | ||||
| 187 | } | ||||
| 188 | # For Unicode, warnings need to be caught and re-issued at this level | ||||
| 189 | # so that callers can disable utf8 warnings lexically. | ||||
| 190 | my $string; | ||||
| 191 | if ( ref($enc) eq 'Encode::Unicode' ) { | ||||
| 192 | my $warn = ''; | ||||
| 193 | { | ||||
| 194 | local $SIG{__WARN__} = sub { $warn = shift }; | ||||
| 195 | $string = $enc->decode( $octets, $check ); | ||||
| 196 | } | ||||
| 197 | warnings::warnif('utf8', $warn) if length $warn; | ||||
| 198 | } | ||||
| 199 | else { | ||||
| 200 | $string = $enc->decode( $octets, $check ); | ||||
| 201 | } | ||||
| 202 | $_[1] = $octets if $check and !ref $check and !( $check & LEAVE_SRC() ); | ||||
| 203 | return $string; | ||||
| 204 | } | ||||
| 205 | 1 | 500ns | *bytes2str = \&decode; | ||
| 206 | |||||
| 207 | sub from_to($$$;$) { | ||||
| 208 | my ( $string, $from, $to, $check ) = @_; | ||||
| 209 | return undef unless defined $string; | ||||
| 210 | $check ||= 0; | ||||
| 211 | my $f = find_encoding($from); | ||||
| 212 | unless ( defined $f ) { | ||||
| 213 | require Carp; | ||||
| 214 | Carp::croak("Unknown encoding '$from'"); | ||||
| 215 | } | ||||
| 216 | my $t = find_encoding($to); | ||||
| 217 | unless ( defined $t ) { | ||||
| 218 | require Carp; | ||||
| 219 | Carp::croak("Unknown encoding '$to'"); | ||||
| 220 | } | ||||
| 221 | my $uni = $f->decode($string); | ||||
| 222 | $_[0] = $string = $t->encode( $uni, $check ); | ||||
| 223 | return undef if ( $check && length($uni) ); | ||||
| 224 | return defined( $_[0] ) ? length($string) : undef; | ||||
| 225 | } | ||||
| 226 | |||||
| 227 | sub encode_utf8($) { | ||||
| 228 | my ($str) = @_; | ||||
| 229 | utf8::encode($str); | ||||
| 230 | return $str; | ||||
| 231 | } | ||||
| 232 | |||||
| 233 | 1 | 100ns | my $utf8enc; | ||
| 234 | |||||
| 235 | sub decode_utf8($;$) { | ||||
| 236 | my ( $octets, $check ) = @_; | ||||
| 237 | return undef unless defined $octets; | ||||
| 238 | $octets .= ''; | ||||
| 239 | $check ||= 0; | ||||
| 240 | $utf8enc ||= find_encoding('utf8'); | ||||
| 241 | my $string = $utf8enc->decode( $octets, $check ); | ||||
| 242 | $_[0] = $octets if $check and !ref $check and !( $check & LEAVE_SRC() ); | ||||
| 243 | return $string; | ||||
| 244 | } | ||||
| 245 | |||||
| 246 | # sub decode_utf8($;$) { | ||||
| 247 | # my ( $str, $check ) = @_; | ||||
| 248 | # return $str if is_utf8($str); | ||||
| 249 | # if ($check) { | ||||
| 250 | # return decode( "utf8", $str, $check ); | ||||
| 251 | # } | ||||
| 252 | # else { | ||||
| 253 | # return decode( "utf8", $str ); | ||||
| 254 | # return $str; | ||||
| 255 | # } | ||||
| 256 | # } | ||||
| 257 | |||||
| 258 | 1 | 1µs | 1 | 363µs | predefine_encodings(1); # spent 363µs making 1 call to Encode::predefine_encodings |
| 259 | |||||
| 260 | # | ||||
| 261 | # This is to restore %Encoding if really needed; | ||||
| 262 | # | ||||
| 263 | |||||
| 264 | # spent 363µs (340+23) within Encode::predefine_encodings which was called:
# once (340µs+23µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 258 | ||||
| 265 | 1 | 51µs | require Encode::Encoding; | ||
| 266 | 2 | 320µs | 2 | 25µs | # spent 16µs (7+9) within Encode::BEGIN@266 which was called:
# once (7µs+9µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 266 # spent 16µs making 1 call to Encode::BEGIN@266
# spent 9µs making 1 call to warnings::unimport |
| 267 | 1 | 400ns | my $use_xs = shift; | ||
| 268 | 1 | 500ns | if ($ON_EBCDIC) { | ||
| 269 | |||||
| 270 | # was in Encode::UTF_EBCDIC | ||||
| 271 | package Encode::UTF_EBCDIC; | ||||
| 272 | push @Encode::UTF_EBCDIC::ISA, 'Encode::Encoding'; | ||||
| 273 | *decode = sub { | ||||
| 274 | my ( undef, $str, $chk ) = @_; | ||||
| 275 | my $res = ''; | ||||
| 276 | for ( my $i = 0 ; $i < length($str) ; $i++ ) { | ||||
| 277 | $res .= | ||||
| 278 | chr( | ||||
| 279 | utf8::unicode_to_native( ord( substr( $str, $i, 1 ) ) ) | ||||
| 280 | ); | ||||
| 281 | } | ||||
| 282 | $_[1] = '' if $chk; | ||||
| 283 | return $res; | ||||
| 284 | }; | ||||
| 285 | *encode = sub { | ||||
| 286 | my ( undef, $str, $chk ) = @_; | ||||
| 287 | my $res = ''; | ||||
| 288 | for ( my $i = 0 ; $i < length($str) ; $i++ ) { | ||||
| 289 | $res .= | ||||
| 290 | chr( | ||||
| 291 | utf8::native_to_unicode( ord( substr( $str, $i, 1 ) ) ) | ||||
| 292 | ); | ||||
| 293 | } | ||||
| 294 | $_[1] = '' if $chk; | ||||
| 295 | return $res; | ||||
| 296 | }; | ||||
| 297 | $Encode::Encoding{Unicode} = | ||||
| 298 | bless { Name => "UTF_EBCDIC" } => "Encode::UTF_EBCDIC"; | ||||
| 299 | } | ||||
| 300 | else { | ||||
| 301 | |||||
| 302 | package Encode::Internal; | ||||
| 303 | 1 | 5µs | push @Encode::Internal::ISA, 'Encode::Encoding'; | ||
| 304 | *decode = sub { | ||||
| 305 | my ( undef, $str, $chk ) = @_; | ||||
| 306 | utf8::upgrade($str); | ||||
| 307 | $_[1] = '' if $chk; | ||||
| 308 | return $str; | ||||
| 309 | 1 | 3µs | }; | ||
| 310 | 1 | 400ns | *encode = \&decode; | ||
| 311 | $Encode::Encoding{Unicode} = | ||||
| 312 | 1 | 2µs | bless { Name => "Internal" } => "Encode::Internal"; | ||
| 313 | } | ||||
| 314 | |||||
| 315 | { | ||||
| 316 | |||||
| 317 | # was in Encode::utf8 | ||||
| 318 | 1 | 4µs | package Encode::utf8; | ||
| 319 | 1 | 2µs | push @Encode::utf8::ISA, 'Encode::Encoding'; | ||
| 320 | |||||
| 321 | # | ||||
| 322 | 1 | 1µs | if ($use_xs) { | ||
| 323 | Encode::DEBUG and warn __PACKAGE__, " XS on"; | ||||
| 324 | 1 | 800ns | *decode = \&decode_xs; | ||
| 325 | 1 | 300ns | *encode = \&encode_xs; | ||
| 326 | } | ||||
| 327 | else { | ||||
| 328 | Encode::DEBUG and warn __PACKAGE__, " XS off"; | ||||
| 329 | *decode = sub { | ||||
| 330 | my ( undef, $octets, $chk ) = @_; | ||||
| 331 | my $str = Encode::decode_utf8($octets); | ||||
| 332 | if ( defined $str ) { | ||||
| 333 | $_[1] = '' if $chk; | ||||
| 334 | return $str; | ||||
| 335 | } | ||||
| 336 | return undef; | ||||
| 337 | }; | ||||
| 338 | *encode = sub { | ||||
| 339 | my ( undef, $string, $chk ) = @_; | ||||
| 340 | my $octets = Encode::encode_utf8($string); | ||||
| 341 | $_[1] = '' if $chk; | ||||
| 342 | return $octets; | ||||
| 343 | }; | ||||
| 344 | } | ||||
| 345 | *cat_decode = sub { # ($obj, $dst, $src, $pos, $trm, $chk) | ||||
| 346 | # currently ignores $chk | ||||
| 347 | my ( undef, undef, undef, $pos, $trm ) = @_; | ||||
| 348 | my ( $rdst, $rsrc, $rpos ) = \@_[ 1, 2, 3 ]; | ||||
| 349 | 2 | 101µs | 2 | 13µs | # spent 12µs (10+2) within Encode::utf8::BEGIN@349 which was called:
# once (10µs+2µs) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 349 # spent 12µs making 1 call to Encode::utf8::BEGIN@349
# spent 2µs making 1 call to bytes::import |
| 350 | if ( ( my $npos = index( $$rsrc, $trm, $pos ) ) >= 0 ) { | ||||
| 351 | $$rdst .= | ||||
| 352 | substr( $$rsrc, $pos, $npos - $pos + length($trm) ); | ||||
| 353 | $$rpos = $npos + length($trm); | ||||
| 354 | return 1; | ||||
| 355 | } | ||||
| 356 | $$rdst .= substr( $$rsrc, $pos ); | ||||
| 357 | $$rpos = length($$rsrc); | ||||
| 358 | return ''; | ||||
| 359 | 1 | 1µs | }; | ||
| 360 | $Encode::Encoding{utf8} = | ||||
| 361 | 1 | 900ns | bless { Name => "utf8" } => "Encode::utf8"; | ||
| 362 | 1 | 1µs | $Encode::Encoding{"utf-8-strict"} = | ||
| 363 | bless { Name => "utf-8-strict", strict_utf8 => 1 } | ||||
| 364 | => "Encode::utf8"; | ||||
| 365 | } | ||||
| 366 | } | ||||
| 367 | |||||
| 368 | 1 | 12µs | 1; | ||
| 369 | |||||
| 370 | __END__ | ||||
# spent 3µs within Encode::CORE:match which was called:
# once (3µs+0s) by BenchmarkAnything::Storage::Search::Elasticsearch::BEGIN@10 at line 7 |