VV
Size: a a a
VV
SZ
VV
VG
VG
Rate encode svref utf8 bytes
encode 166779/s -- -91% -98% -99%
svref 1827673/s 996% -- -80% -85%
utf8 9282929/s 5466% 408% -- -25%
bytes 12320105/s 7287% 574% 33% --
SZ
VG
VG
VG
VV
VG
VV
Rate svref utf8 bytes already
svref 2994789/s -- -76% -88% -91%
utf8 12570647/s 320% -- -49% -61%
bytes 24653041/s 723% 96% -- -23%
already 31913183/s 966% 154% 29% --
SZ
VV
SZ
AT
perl -MBenchmark=/./ -MB=svref_2object -MEncode -Mstrict -Mwarnings -Mutf8 -CSD -le 'my ($in, $out) = Encode::encode(q(UTF-8), qq(\N{GREEK SMALL LETTER SIGMA}x1000)); cmpthese -1 => {bytes => sub { {use bytes; $out = length $in } }, utf8 => sub { $out = utf8::upgrade($in) }, already => sub { $out = length($in) }, svref => sub { $out = svref_2object(\$in)->CUR }, }'
Rate svref utf8 bytes already
svref 6313100/s -- -80% -90% -96%
utf8 31959500/s 406% -- -48% -81%
bytes 61008058/s 866% 91% -- -64%
already 168574897/s 2570% 427% 176% --
AT
VV
AT
VV