Skip to content

BestFirstSearch: relax cost check w/ optimal token#4854

Open
kitbellew wants to merge 2 commits intoscalameta:mainfrom
kitbellew:4853
Open

BestFirstSearch: relax cost check w/ optimal token#4854
kitbellew wants to merge 2 commits intoscalameta:mainfrom
kitbellew:4853

Conversation

@kitbellew
Copy link
Collaborator

Rather than requiring that state cost remain unchanged with the latest split, let's limit it to checking that the original cost of the split (before any penalties may have been applied) is zero, and that the state does not overflow.

This leads to extremely rare formatting changes (none on scala, spark, scalafmt, scalameta repos) and on average over a 5% improvement in the BestFirstSearch algorithm efficiency.

This approach protects optimal-token intentions from penalties which are designed to rank different states, and is a follow-on to #4851.

Rather than requiring that state cost remain unchanged with the latest
split, let's limit it to checking that the original cost of the split
(before any penalties may have been applied) is zero, and that the
state does not overflow.

This leads to extremely rare formatting changes (none on scala, spark,
scalafmt, scalameta repos) and on average over a 5% improvement in the
BestFirstSearch algorithm efficiency.

This approach protects optimal-token intentions from penalties which
are designed to rank different states, and is a follow-on to scalameta#4851.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant