Created
January 30, 2015 19:09
-
-
Save moritz/8ceacf454fb1f5af9461 to your computer and use it in GitHub Desktop.
rakudo pod parsing slowness when '=end pod' is missing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
sub timeit(Int $lines-after) { | |
my $preamble = qq[=begin code\n]; | |
my $str = join "\n", $preamble, "Some more happy, happy lines of B<pod>\n\n including code\n\n" xx $lines-after; | |
my $before = now; | |
try EVAL qq[=begin pod\n\n$str\n\n\=end pod\n"]; | |
my $after = now; | |
return $after - $before; | |
} | |
for ^50 -> $t { | |
given $t * 1 { | |
say join "\t", $_, timeit($_); | |
} | |
} | |
# output: | |
# | |
# 0 0.010546 | |
# 1 0.0218128 | |
# 2 0.10669325 | |
# 3 0.7040623 | |
# 4 5.6502557 | |
# 5 45.8098792 | |
# (here I lost patience) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment