Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created Apr 10, 2022
Embed
What would you like to do?
bisectable6
my &c; given 'one'.comb { when 3 { &c = { say '$_:', $_.raku }; } }; &c();
Bisecting: 108 revisions left to test after this (roughly 7 steps)
[21829c33f6831cf567663dc91071ea6dd009ed53] Make the adverbless zen-slice (@a[]) a few percent faster
»»»»» Testing 21829c33f6831cf567663dc91071ea6dd009ed53
»»»»» Script output:
$_:Rakudo::Internals::LoweredAwayLexical
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is different
»»»»» Therefore, marking this revision as “new”
»»»»» -------------------------------------------------------------------------
»»»»» Testing d4fde77d2a08d3354c6845b56caaa64e7155eeca
»»»»» Script output:
$_:Rakudo::Internals::LoweredAwayLexical
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is different
»»»»» Therefore, marking this revision as “new”
»»»»» -------------------------------------------------------------------------
»»»»» Testing 90a04ac01a0bec5de3906d8ecef89496666a9da1
»»»»» Script output:
$_:Rakudo::Internals::LoweredAwayLexical
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is different
»»»»» Therefore, marking this revision as “new”
»»»»» -------------------------------------------------------------------------
»»»»» Testing 9f80771c91c0fad65ceade5a6309a1decd5dcc79
»»»»» Script output:
$_:("o", "n", "e").Seq
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is identical
»»»»» Therefore, marking this revision as “old”
»»»»» -------------------------------------------------------------------------
»»»»» Testing 7f1189fe757045119b5779b2c5280c48dbc87d83
»»»»» Script output:
$_:Rakudo::Internals::LoweredAwayLexical
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is different
»»»»» Therefore, marking this revision as “new”
»»»»» -------------------------------------------------------------------------
»»»»» Testing 91ec1bbf601f2b9060a3ffc481407508296a481d
»»»»» Script output:
$_:Rakudo::Internals::LoweredAwayLexical
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is different
»»»»» Therefore, marking this revision as “new”
»»»»» -------------------------------------------------------------------------
»»»»» Testing 5855c1d55786adff02cc54d882167cfbdfaa6e43
»»»»» Script output:
$_:("o", "n", "e").Seq
»»»»» Script exit code: 0
»»»»» Bisecting by output
»»»»» Output on “old” revision is:
$_:("o", "n", "e").Seq
»»»»» The output is identical
»»»»» Therefore, marking this revision as “old”
91ec1bbf601f2b9060a3ffc481407508296a481d is the first new commit
commit 91ec1bbf601f2b9060a3ffc481407508296a481d
Author: Vadim Belman <vrurg@lflat.org>
Date: Sat Dec 11 22:34:11 2021 -0500
Implement optimization of topicalized smartmatches
Topicalization is not needed in typematch case if RHS uses the default
ACCEPTS method.
Also, when we know variable/routine type and can ensure it cannot be a
Regexp then the code can be simplified to just `ACCEPTS`+`Bool` method
calls.
Aside of this, smartmatch optimizator depends on operand nodes to be
pre-optimized. This lets it do better analysis. But it was also
resulting in incorrect statistics collected about localizable variables
whenever the smartmatching node is replaced entirely.
Fixing this required a new approach with two-pass optimization where the
first pass is done without collecting the variable statistics and
localization pass. The statistic collection is now prevented by wrapping
the `@!block_var_stack` attribute into a specialized `BlockVarStack`
class. All method calls used to be done on the stack top element must
now be made via `BlockVarStack` `do` method. The class supports dry run
mode when method invocations via `do` are ignored.
Smartmatch optimizer uses dry run for first-pass optimization of its
operands.
Some code re-arrangements took place to improve re-usability.
:040000 040000 042be0cfcc9060ade508486fd28c24f039a4a5dc e9d9255fa689acca0d31ab7e6cb32d416692069a M src
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment