-
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
Fix #97: Avoid spurious recompilations when unrelated constructor changes #288
Conversation
044e71b
to
1bd0158
Compare
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.
LGTM. This is a great change!
Thank you for the docs, too. Let's request another review from the Ligthbend team. In the meanwhile, I'll try to see the interaction of this PR with potential corner cases, just to be sure this is ready to go!
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.
The change itself looks good.
I wonder if we should start a markdown file documenting mangling rules.
@smarter Give me until next Monday to think about potential interactions, and we merge 😉. I just want to be sure. |
Ping for review. |
I already gave my 👍 so we're waiting on @jvican? |
This change looks great, I've confirmed this will not have a bad interaction with anything. I was worried about the format representation and wanted to double check that it was unique. I am resolving the conflicts caused by the formatting PR manually, and when the light is green I'm merging. |
1bd0158
to
a3f26d8
Compare
Travis was blocked, that's why I closed and opened again. I'll merge this when it's green. |
a3f26d8
to
60d7978
Compare
…changes The name hashing algorithm is designed to take implicit conversions into account: when a name "foo" is changed somewhere in a dependency of X, you have to recompile X if it uses the name "foo", even if the usage of "foo" in X is completely unrelated, just because this might have an effect on available implicit conversions. However, there is one case where we can be sure that implicit conversions will not kick in: when we call a constructor. A constructor name is always "<init>", this PR now replaces this name by "pkgA;pkgB;className;init;", this mean that we no longer recompile classes when an unrelated constructor in a used class changed (see the new test `constructors-unrelated` for an example).
60d7978
to
aca8dfa
Compare
Use a different encoding for constructor: constructor.enclosingClass.fullName ++ ";init;"
Use a different encoding for constructor: constructor.enclosingClass.fullName ++ ";init;"
The name hashing algorithm is designed to take implicit conversions into
account: when a name "foo" is changed somewhere in a dependency of X,
you have to recompile X if it uses the name "foo", even if the usage of
"foo" in X is completely unrelated, just because this might have an
effect on available implicit conversions. However, there is one case
where we can be sure that implicit conversions will not kick in: when we
call a constructor. A constructor name is always "<init>", this PR now
replaces this name by "pkgA;pkgB;className;init;", this mean that we no
longer recompile classes when an unrelated constructor in a used class
changed (see the new test
constructors-unrelated
for an example).