Skip to content

Drop per-run infrastructure #6965

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 4 commits into from
Aug 2, 2019
Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Jul 30, 2019

The per-run infrastructure caused a 10-20% performance hit. We could go back to the old
caching scheme but this is verbose and ugly. This commit drops the whole caching infra
structure instead. The downside is that we need a new compiler if any symbol cached
by Definitions has been edited and should be reloaded.

odersky added 4 commits July 30, 2019 11:34
The per-run infrastructure caused a 10-20% performance hit. We could go back to the old
caching scheme but this is verbose and ugly. This commit drops the whole caching infra
stricture instead. The downside is that we need a new compiler if any symbol cached
by Definitions has been edited and should be reloaded.
Without re-binding in Definitions we cannot run a FromPickling
test that overwrites the scala package object.
@odersky
Copy link
Contributor Author

odersky commented Jul 30, 2019

test performance please

@dottybot
Copy link
Member

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

@dottybot
Copy link
Member

Performance test finished successfully:

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

Benchmarks is based on merging with master (52fe263)

@odersky
Copy link
Contributor Author

odersky commented Jul 30, 2019

Comparing with #6962, we seem to get about 2-3% speed improvement over the previous scheme that uses two entries per definition. So it's not only simpler but faster as well. My tendency would be to use this PR instead of #6962.

@smarter
Copy link
Member

smarter commented Jul 30, 2019

It might be possible to get the seqtype-cycle pickling test to pass by running it using -sourcepath

@odersky
Copy link
Contributor Author

odersky commented Jul 31, 2019

It might be possible to get the seqtype-cycle pickling test to pass by running it using -sourcepath

OK, can you or Nicolas try that out?

@smarter
Copy link
Member

smarter commented Jul 31, 2019

I had a quick look but it's likely that this would break in other ways, I would just drop the test since the way it works is a bit too fragile.

@nicolasstucki
Copy link
Contributor

The downside is that we need a new compiler if any symbol cached by Definitions has been edited and should be reloaded.

In practice, when would we need a new compiler?

@odersky
Copy link
Contributor Author

odersky commented Aug 2, 2019

In practice, when would we need a new compiler?

It would be if we run with a resident compiler and edit a file touched by Definitions, such as Seq.scala. That would give us a StaleSymbol error. The most common scenario is if the compiler runs in an IDE. However, we already handle stale symbols in the IDE, so I am not sure where it would matter in practice.

I believe ~compile is not a true resident compiler, or is it? I mean, do we keep the same instance of Compiler across several runs with ~compile?

@smarter
Copy link
Member

smarter commented Aug 2, 2019

I believe ~compile is not a true resident compiler, or is it? I mean, do we keep the same instance of Compiler across several runs with ~compile?

No, it always creates a new compiler instance.

@odersky
Copy link
Contributor Author

odersky commented Aug 2, 2019 via email

@odersky odersky merged commit 95ae77c into scala:master Aug 2, 2019
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