-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Investigate inefficient object layouts #3135
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
Comments
@smarter worth keeping this one open? If so, mind if we move it to dotty feature requests? |
I don't see how it's a feature request, it's a possible performance improvement. I have no opinion on whether keeping it open or closed is better. |
(this is of course a broader discussion than just this one ticket, but:) I don't think we should get too hung up on the word "feature". Improving object layout is an enhancement request. dotty-feature-requests seems to us like a better place to keep open-ended, unclear-priority enhancement tickets than here, given Martin's/the-team's ongoing interest in not allowing the number of open tickets in this repo to grow without bounds. |
But the feature request repo is supposed to be a user-facing thing, where users can vote on features they care about, not a dumping ground for compiler internals stuff. I'll just close this. |
"Dumping ground" seems pejorative :-) How about converting it to a Discussion? We could have a category of discussions for internal-facing enhancement ideas. |
I could see discussions working for open-ended stuff like that yeah. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Using http://hg.openjdk.java.net/code-tools/jol/ we can inspect the layout of objects on the JVM, this is useful to see if there's anything we can optimize in our code, and to check how our object layout differs from what scalac generates:
As an example, here's the layout of
InitialContext
:deskolemize
probably doesn't need to be a field in every Context. It's especially costly because it's defined as anobject
and thus translated to a lazy val (which requires an extra fieldbitmap$0
in the dotty encoding compared to scalac). I just made a PR for this: #3136The text was updated successfully, but these errors were encountered: