Investigate inefficient object layouts #14254
Replies: 6 comments
-
@smarter worth keeping this one open? If so, mind if we move it to dotty feature requests? |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
(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. |
Beta Was this translation helpful? Give feedback.
-
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. |
Beta Was this translation helpful? Give feedback.
-
"Dumping ground" seems pejorative :-) How about converting it to a Discussion? We could have a category of discussions for internal-facing enhancement ideas. |
Beta Was this translation helpful? Give feedback.
-
I could see discussions working for open-ended stuff like that yeah. |
Beta Was this translation helpful? Give feedback.
-
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: #3136Beta Was this translation helpful? Give feedback.
All reactions