И
Rate svref utf8 bytes already
svref 4071762/s -- -79% -90% -96%
utf8 19486810/s 379% -- -52% -83%
bytes 40777955/s 901% 109% -- -64%
already 114019915/s 2700% 485% 180% --
Поэтому вообще не показатель))
Size: a a a
И
Rate svref utf8 bytes already
svref 4071762/s -- -79% -90% -96%
utf8 19486810/s 379% -- -52% -83%
bytes 40777955/s 901% 109% -- -64%
already 114019915/s 2700% 485% 180% --
AT
perl -MBenchmark=/./ -Iblib/arch -Iblib/lib -Ilib -MB=svref_2object -Mstrict -Mwarnings -Mutf8 -CSD -le 'my ($in, $out) = q(привет); cmpthese -2 => { bytes => sub { {use bytes; $out = length $in } }, utf8 => sub { $out = utf8::upgrade($in) }, encode => sub { use Encode q(encode); $out = length(encode(q(UTF-8), $in)) }, svref => sub { $out = svref_2object(\$in)->CUR }, }'
Rate encode svref utf8 bytes
encode 771009/s -- -88% -98% -99%
svref 6401186/s 730% -- -81% -92%
utf8 34177532/s 4333% 434% -- -55%
bytes 75629765/s 9709% 1081% 121% --
SZ
AT
AT
SZ
SZ
VV
time perl -E 'for(1..500_000_000){}'
AT
SZ
VV
И
AT
v5.16.3
real
0m6.712s
v5.34.0
real
0m3.861s
A
Intel(R) Core(TM) i7-10750H CPU @ 2.60GHzполучилось вот так
svref 3389792/s -- -82% -87% -94%
utf8 19309775/s 470% -- -25% -65%
bytes 25664447/s 657% 33% -- -53%
already 55050239/s 1524% 185% 114% --
A
$ lsb_release -a
No LSB modules are available.
Distributor ID: Linuxmint
Description: Linux Mint 20.2
Release: 20.2
Codename: uma
AT
SZ
DF
VG
VG