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

Java already compiles to bytecode, which executes on the JVM. But this is too slow for most practical applications. JIT compilation to native code is crucial for execution of Java programs with competitive speed.

It would be possible to compile everything to machine code ahead of time (pretty much what GraalVM does), but that would compile everything even if it would never end up being executed*. Without JIT compiler, it would not be possible to recompile code to take advantage of tracing information gathered at runtime. Also, newly loaded Java code would not be able to be optimized at all.

There are workarounds for all of these. For example, the JIT compiler could generate a new executable with the optimized code and migrate execution state to a new process. But it seems very clunky.

*: Not really an issue with microservices and stripped-down binaries. A huge deal for IDEs and environments with plugin architecture though.



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

Search: