-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix bootstrap, take 3 #1477
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
Fix bootstrap, take 3 #1477
Conversation
@DarkDimius I added the quckfix you suggested with |
The single failed test is related to |
I can't reproduce the benchmark on my machine because of #1478. Don't know why it happens. |
@@ -56,6 +56,7 @@ trait SymDenotations { this: Context => | |||
stillValid(owner) && ( | |||
!owner.isClass | |||
|| owner.isRefinementClass | |||
|| owner.is(Scala2x) |
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 reminds me of 4b0cc8a which fixed an issue with stale Java symbol and outer fields, are you sure that the stale outer field here is not incorrectly generated by Dotty?
@odersky, I'm not sure how you managed to make the mixed bootstrap work.
|
Maybe we should add explicit type signatures where needed to workaround this. |
Instead of using the partially bootstrapped dotty, I can safely use dotty that is entirelly compiled by dotty. To obtain it, you need to run in sbt:
This will create a
|
This can be avoided by compiling dotty in language:Scala2 mode. Correction: No we do not do that (yet). Not sure what's the best way to handle this. On Fri, Aug 26, 2016 at 11:28 AM, Guillaume Martres <
Prof. Martin Odersky |
OK, now just have to fix that single test failure. |
@odersky, the test failure has to do with the |
a quick heads-up. By quickly porting some optimizations(copy propagation and de-inlining) from linker I was able to get dotty compile time down to 19 sec(from 21sec) compared to 17 sec when compiled by scalac. I'm not done yet, but hopefully I'll be able to push a version of linker capable of compiling dotty into a version faster than compiled by scalac until ScalaWorld. |
Excellent. I can't wait! (but i will) On Mon, Aug 29, 2016 at 3:31 PM, Dmitry Petrashko notifications@github.com
Prof. Martin Odersky |
Could the regression have the same root cause as http://scala-lang.org/blog/2016/07/08/trait-method-performance.html ? |
On Mon, Aug 29, 2016 at 4:04 PM, Guillaume Martres <notifications@github.com
Prof. Martin Odersky |
I don't think so. We don't use many traits in compiler and in both cases On 29 August 2016 16:04:52 Guillaume Martres notifications@github.com wrote:
|
Current status: I needed to change label-defs a lot and it somehow introduced a substantial slowdown of generated code by around 2-3x(40 secs compilation time). Trying to figure out why. |
I would like make a fix to this our first priority. |
/rebuild |
@odersky it seams that we fixed the the issue with |
1. There may be calls to super on non-this. 2. there may be calls to in-dirrect super-traits.
Need to do time travel to find out whether members were created as static symbols. After LambdaLift and Flatten most symbols are static anyway.
Wehn compiling dotty repeatedly using dotc.Bench, we got a stale symbol error involving an outer field of a Scala class. These can always be assumed to be current, as we would not think to recompile Scala2 classes mixed with dotty classes in the same session (we'd need two concurrent compilers for that).
101d85e
to
dfa4ea4
Compare
Indeed, looks like it works now. I rebased to current master. Once the tests pass, I think we should merge. |
In fact, no, it does not work. With the current commits I get when I try to run the dotty-compiled compiler again: /Users/odersky/workspace/dotty/src/dotty/tools> timed-bootstrap-repeated -d /classes |
And, I should note, if I remove the last commit "Remove quick fix", the bootstrap passes. So the quickfix is needed, but it should be studied wether it does the right thing. |
Advice to everyone: When compiler boostrapping, don't trust any runner to do what you think it does. You are most often wrong, and see something else tested. To reproduce, I put all needed jars on my CLASSPATH, then cd to
where the output directory |
Which are the 'needed jars'? |
On Wed, Sep 21, 2016 at 7:28 AM, Nicolas Stucki notifications@github.com
setenv CLASSPATH
Prof. Martin Odersky |
Add comment what it is supposed to achieve and change the implementation to follow the comment.
dfa4ea4
to
c9d670f
Compare
I think I fixed the problem at the root, by changing CollectSuperCalls. Bootstrap works now. |
With these fixes we now can measure times of bootstrapping dotty.
The command I used was (in directory src/dotty/tools):
where I have
and
/classes
is on my classpath. Then run the same command again, this time the class files will be picked up from/classes
, so we are testing the dotty-generated compiler.Each command runs the dotty compiler 3 times on its own sources, keeping classes loaded. Here are the timings I got on my 4-year old MacBook:
So overall 20-25% slower after warm-up. That's the gap we need to close.