Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
RFC: Partially inline junctions in bool context at compile time #101
In this branch, I've implemented a runtime optimisation that turns this:
into (more or less) this:
in if, unless, while and until statements. On my machine, it doesn't change the run time of the whole spectest by any significant amount, but in this simple benchmark it reduces run time from 5.2 seconds down to 3.2 (down to 60%!):
And even a simple test suite that doesn't contain loops gets the same 40% reduction apparently :)
Building rakudo itself takes only 1.5 seconds longer out of 180 seconds on this branch, so about 1% time increase. Doesn't sound too bad.
Looking for more things to put in or examples that break with this branch. One example is, that any(), all() and one() aren't touched yet, they generate a call to infix:<,>, which I don't handle yet. Also, apparently if the op between the junction and the other side is ~~, it gets skipped, too - it seems that's because the tree gets a bind for $_ out of it.
Tests have been added to the spec suite to make sure nothing strange happens accidentally.