parrot/parrot — pull request #1027 by timo (2013-11-23 19:43:28+00:00)
Title: cache iterators in encoding_find_*cclass.

encoding_find_cclass and encoding_find_notcclass can now cache an iterator between calls, because there is at least one usage of the pattern "scan a whole string for newlines" in rakudo.

for utf8 files, like Actions.nqp and Grammar.nqp, it used to take 5s and 2s respectively, now takes 2.4s and 0.9s respectively after the patch.

it passes all the parrot tests and (when applied to RELEASE_5_9_0) compiles nqp and rakudo no-problem.