There's still another "tiny mistake" with your code, which is that the following snippet doesn't generate a string of length 1024001, but a string of length 1:
my $string = pack "A*" => map { chr (32 + int rand 95) } 0..1024000; print length($string);
Done properly, i.e. either using pack "(A)*", ..., or join '', ..., or the much more memory-friendly
my $string; $string .= chr(32 + int rand 95) for 0..1024000;
I get the following quite different results:
Rate subsingle subplus tran subsingle 18.5/s -- -15% -93% subplus 21.9/s 18% -- -92% tran 268/s 1345% 1121% --
In reply to Re^4: Remove all non alphanumeric characters excluding space, underscore and minus sign (Benchmark--)
by Eliya
in thread Remove all non alphanumeric characters excluding space, underscore and minus sign
by ikkeniet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |