Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Java forces you to use profiling, at least with C you can see the exact instructions your compiler outputs. Missing the fancy vector instructions? Modify your code til you can guarantee it's vectorized. With Java you are at the mercy of the JVM to do the right thing at runtime.


Not that I disagree with what you're saying, but I thought you'd find it interesting: you can dump the JIT assembly from Hotspot JVM pretty readily to make sure things like inlining are happening as you'd expect.


You can also view the entire compiler internals in a visual way using the igv tool. You can actually get much better insight into how your code is getting compiled on a JVM like the GraalVM than with a C compiler.

However, I will admit that this is very obscure knowledge.


Java also allows to see the exact instructions the JIT/AOT compiler outputs, it is a matter of learning the tools.


The instructions no longer tell the whole story though. Maybe you can tell whether your code is vectorised, but you can't tell whether your data is coming out of main memory or L1 cache, and to a first approximation that's the only thing that matters for your program's performance.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: