4 ms·
Very interesting. Would possibly improve the performance of some programs, as iterating over an array of value types will actually be sequential memory access,
by mnw21cam 13y ago
Very interesting. Would possibly improve the performance of some programs, as iterating over an array of value types will actually be sequential memory access, whereas iterating over an array of objects involves skipping everywhere over memory.
- taeric 13y agoDoes seem to go counter to a long standing culture of "let the VM decide" that has dominated in the JVM landscape for a while. I will be curious to see how this affects code targeting android and friends.
- pron 13y agoNot quite. Unlike C# structs, this is not a memory-layout choice, but a semantic choice. Value types have specific semantics: immutable, atomic, non-extendable etc. It is up to the VM to choose how to lay them out in memory, but an on-stack/inlined-in-array storage would be possible.
- taeric 13y agoOh, I miss understood and thought this was just about the memory layout problem. Oops. :)
- oddthink 13y agoIt's definitely encouraging. I don't know what the current state of the art is, but one of the main conclusions of the NIST Java Grande working group back in 2000-2003ish was that lack of a complex type was one of the big things holding Java back for numerical work. There was a wave of excitement about doing numerics in Java around 2000ish, but it seems like everyone has since moved on.