4 ms·
It basically has nothing to do with the JVM. These speedups are entirely a function of how modern processors work. To some extent the platform/language matters
by jackowayed 14y ago
It basically has nothing to do with the JVM. These speedups are entirely a function of how modern processors work. To some extent the platform/language matters because its guarantees determine how easily you can achieve good memory locality.
(For example, one could implement a java compiler that correctly made all Java code work, but gave absolutely no memory locality--different instance variables of an object could be arbitrarily far apart, and you could even implement arrays as linked lists (or at least chunk lists) so that arrays don't guarantee locality either. One couldn't make the optimizations he made under those conditions. But any language where you know what data will be contiguous allows you to make these optimizations.)
I'd guess that you knew this, but your comment suggests that there's something special about the JVM that makes it especially well-suited for these optimizations, which might confuse readers.
- zippie 14y agoI was trying to convey the opposite, as you stated, that inefficient memory access is not limited to the JVM.