Presentation by Simon Ritter on getting the performance benefits of C-Structs using the ObjectLayout OpenJDK changes for the Java compiler.
Java is a powerful language and platform and in many cases can match or even exceed the performance of natively compiled languages like C and C++. However, there is one area where this is not the case, which is the use of structs, where machine level optimisations work very well. To address this, there is an open source project, ObjectLayout (objectlayout.org), which provides an API where pre-fetching and caching can deliver performance gains. The beauty of this approach is that no changes are required either in the Java language or in the JVM. However, the JVM can be modified to use intrinsics when processing the API to improve performance further. The design and ideas behind the API will be discussed as well as ideas for how the JVM can be enhanced.