-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router: extract rules to Splits, use class lookup #4848
Conversation
8dc7bd1
to
fed7672
Compare
this is a tricky change :) i tested on scala2+scala3+spark community repos that community-tests runs on, and it produces the same results, but conceivably could be different. if you could check on your repos, would appreciate it. |
A profiler run revealed that `getSplits` is the largest bottleneck of performance, despite being run only once, almost double that of the part which was previously thought to be the more expensive: BestFirstSearch. Let's refactor away from using a massive `match` to several lookups by the token class.
I checked Metals and Scala CLI repos and the results seem the same, but I only changed version in .scalafmt.conf and run using the jar based runner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM though I don't really have time to look at the full changes.
Yes, alas, this change is not easily reviewable. The code is basically the same but in different places; but even with that, there were a few tricky parts:
|
A profiler run revealed that
getSplits
is the largest bottleneck of performance, despite being run only once, almost double that of the part which was previously thought to be the more expensive: BestFirstSearch.Let's refactor away from using a massive
match
to several lookups by the token class.In community-tests runs, there's a 35% reduction in running times (22 minutes to 14, 15 to 10).