...
sub lookbehind {
my $x = shift;
split '(?:(?<=[^#]####)|(?<=[^#]##)|(?junk8
Subroutine Benchmark::mytime redefined at c:/Perl/lib/Benchmark.pm line 459.
Benchmark:
timing 10000 iterations of
lookbehind, rollahead, unroll
...
lookbehind: 2.34183 wallclock secs ( 2.19 usr + 0.00 sys = 2.19 CPU) @ 4570.38/s (n=10000)
rollahead: 3.46343 wallclock secs ( 3.23 usr + 0.00 sys = 3.23 CPU) @ 3092.15/s (n=10000)
unroll: 3.51775 wallclock secs ( 3.33 usr + 0.02 sys = 3.34 CPU) @ 2990.43/s (n=10000)
Rate unroll rollahead lookbehind
unroll 2990/s -- -3% -35%
rollahead 3092/s 3% -- -32%
lookbehind 4570/s 53% 48% --
####
rollahead => @# #@## ##@ ##@## #@# # @# #@## ##@@# #@## ##@@# #@ ...
unroll => @# #@## ##@ ##@## #@# @# #@## ##@@# #@## ##@@# #@# ...
####
lookbehind => #@## ###@#### #####@ #####@#### ###@## # #@## ###@#### ...