-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Some more optimizations #3217
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
Some more optimizations #3217
Conversation
This simple change brings down the number of calls to `hasRedefinedMethod` from 24'000 to 3'500. This makes me wonder whether `LinkAll` is using the Phase framework in the right way. As far as I can see nobody else calls MiniPhase.runOn
@@ -36,7 +36,7 @@ class LinkAll extends MiniPhaseTransform { | |||
} | |||
|
|||
if (ctx.settings.XlinkOptimise.value) super.runOn(allUnits(Set.empty, units.toSet, Set.empty)) |
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.
This came from the design that @DarkDimius showed me to add new compilation units. I mostly looked at it from a functional point of view, not a performance one. I will have a look and see if it can be done in a better way.
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.
I see. In essence, MiniPhase.runOn calls the indexing framework that figures out the method call plan. I thought that would be done before, but it seems not (maybe because we don't have the right context before?). The problem with that approach is that it is done afresh for each compilation unit, even if it
is always the same computation.
Nobody except LinkAll seems to call runOn
, however.
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.
This is probably cleaner #3219, there was not a good reason for it to be a miniphase. That PR should further improve performance on LinkAll
.
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.
If I remember correctly runOn
was designed specifically for the purpose of adding new compilation units. Until LinkAll
this use case was only used in the linker fork.
test performance please |
performance test scheduled: 1 job(s) in queue, 0 running. |
Performance test finished successfully: Visit http://dotty-bench.epfl.ch/3217/ to see the changes. Benchmarks is based on merge(s) with master |
No description provided.