Skip to content

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

Merged
merged 3 commits into from
Sep 30, 2017
Merged

Some more optimizations #3217

merged 3 commits into from
Sep 30, 2017

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Sep 30, 2017

No description provided.

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))
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@odersky
Copy link
Contributor Author

odersky commented Sep 30, 2017

test performance please

@dottybot
Copy link
Member

performance test scheduled: 1 job(s) in queue, 0 running.

@dottybot
Copy link
Member

Performance test finished successfully:

Visit http://dotty-bench.epfl.ch/3217/ to see the changes.

Benchmarks is based on merge(s) with master

@smarter smarter merged commit be01457 into scala:master Sep 30, 2017
@allanrenucci allanrenucci deleted the try-optimize-2 branch December 14, 2017 19:25
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.

4 participants