ssinyagin/torrus-newfeatures — comment on commit dac9229db3400c8721fbe769f27b94c8c89b3d17
File:  line 0
By ssinyagin:

actually with a bit more careful testing, length() appears slightly faster, but not really dramatically faster:

$ time perl -e '$a=""; for $b (1..26) {$a .= $a . $b}; for $b (1..10000000) {$c = ($a eq q||)}'

real 0m1.428s
user 0m1.380s
sys 0m0.046s
$
$ time perl -e '$a=""; for $b (1..26) {$a .= $a . $b}; for $b (1..10000000) {$c = ($a eq q||)}'

real 0m1.337s
user 0m1.288s
sys 0m0.049s
$ time perl -e '$a=""; for $b (1..26) {$a .= $a . $b}; for $b (1..10000000) {$c = length($a)}'

real 0m0.941s
user 0m0.892s
sys 0m0.049s
$ time perl -e '$a=""; for $b (1..26) {$a .= $a . $b}; for $b (1..10000000) {$c = length($a)}'

real 0m1.026s
user 0m0.984s
sys 0m0.042s