It seems calls to =destroy and =copy are added due to the lookaround operation, even if the lookaround code itself is never ran (not even the outer loop). Commenting out this line makes match +2x faster. Found that with the benchmark + valgrind. Sadly, valgrind does not tell me on what object it's called, but it goes away after removing all var parameters. Also, it does not makes sense why it would copy that (maybe because the lookaround call is recursive?).
It seems calls to
=destroy
and=copy
are added due to the lookaround operation, even if the lookaround code itself is never ran (not even the outer loop). Commenting out this line makes match +2x faster. Found that with the benchmark + valgrind. Sadly, valgrind does not tell me on what object it's called, but it goes away after removing all var parameters. Also, it does not makes sense why it would copy that (maybe because the lookaround call is recursive?).