-
Notifications
You must be signed in to change notification settings - Fork 121
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
-opt:l:inline breaks incremental compilation #537
Comments
Basically, if a method is inlineable, its body is part of its API signature. We deal with that in dotty by storing the pretty-printed body of the method in a signature in ExtractAPI, though it'd be better to store a hash: https://github.com/lampepfl/dotty/blob/a3c4ec793545fd2b922eb469f7fc4d4a7d26b05f/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala#L593-L602 |
Interesting. That would give better usability compared to invalidating all sources :) |
What about |
Does that actually do anything in Scala 2.12 ? |
per the docs it should, and I just checked it in the repo linked above; with call-site @inline
no @inline
|
Huh. I would vote to deprecate that feature then :P |
Could we deprecate all inlining? |
It can be pretty important for performance |
http://slides.com/cb372/inline-specialized-berlin-2016#/27 says it's slightly slower when used with HotSpot, in that particular benchmark. |
For now, we should at least print warnings if it's anything less than 100% compilation. To potential contributor. Related source might be https://github.com/sbt/zinc/blob/v1.1.7/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala#L125-L132 |
Uf, I haven't looked at the details but fixing this it's quite complicated. We would need to teach Zinc:
I vote to:
I'm optimistically labelling this |
I still think it makes sense for the scalac bridge to implement what I said in #537 (comment) |
Missed that. Can the scalac genbcode ever inline something that is not marked as |
Yes with call-site |
Let's start the petition for the call-site inline removal. Where do we start? |
I suggest making a PR to scala/scala that drops the feature and put a warning in its place. |
Would love to see both reasons and tests for this. I see #537 (comment) as a much more reasonable compromise. |
Currently (2.13.12),
The Also, everyone is 5 years older since the previous comments. |
Yeah... I honestly thought that #1310 would cut it, until I tested the PR fix against 2.13.12...
Maybe I can advertise myself as a historian as I now have experience with digging up 5 year old archaic zinc ticket. |
This was originally reported by @eparejatobes as sbt/sbt#4125 (comment)
Copying here the relevant portion of the link above; see ohnosequences/sbt4125 for more
steps
Open a shell and
git checkout "x=1"
Now run
sbt
on a different shell and do~test
. Once it runs for the first time,git checkout "x=2"
Take a look at the test passing, and the definitions of
x
andy
.problem
expectation
I'd say we revise the expectation to be that change to
x=2
is reflected in compilation and run.notes
I am not sure how prevalent these optimization flags are, but we should probably print warning or invalidate all sources, similar to 50% threshold mechanism.
The text was updated successfully, but these errors were encountered: