Great article. Very comprehensive and well written, while not skipping the gotchas the author hit along the way
I don't really much about how the JVM works, but it's interesting that this is (if I understood correctly) in effect calling out to some native code. In the JVM world, when are things added to the byte code as a new instruction, and when are they wrapped up in a native code call?
I'd expect a new vector instruction for the stack machine, but I'm guessing that's less flexible and less performant..?
"Practically speaking, you end up with code that looks like it creates many objects, but actually compiles to code that allocates no memory. It is extremely disconcerting."
It's interesting comparing people working in Java vs C++. Java makes it so impractical to really reason about the code directly that users ends up relying a lot more on tooling for benchmarking and introspection (and hence the tools are top-class)
"Java’s ability to print its compiler output as assembly "
How do you do this? Is this integrated into the IDE?
While the tools are great and you can dissect all your performance problems, ultimately feedback from the compiler should be feeding back into the editor. I feel that some of the issues the author hit shouldn't happen. You should for instance be immediately able to see if a function is being inlining while you're editing and not having to run extra tools
Then there are other ways depending on which JVM implementation is used.
On OpenJDK's case you can load runtime plugin to do it