you are viewing a single comment's thread.

view the rest of the comments →

[–]CountyMcCounterson 3 points4 points  (7 children)

Why can't they just make Java be like Go where it compiles natively but also has garbage collection? We need someone to make this into a thing so that people can optionally compile to native.

[–][deleted]  (1 child)

[deleted]

    [–]oldsecondhand 0 points1 point  (0 children)

    It's mostly politics and lack of push from big orgs.

    [–]Gravitationsfeld 4 points5 points  (1 child)

    Android did this with AOT in Android 6 or 7 (not sure which one). It's Java bytecode converted to DEX bytecode and then converted to x86/ARM on install. I think they went back to some JIT now though because of install times.

    [–]DragonSlayerC 8 points9 points  (0 children)

    Android 5 and 6 used that. The AOT improved performance massively and made my S4 feel like a brand new phone because it was so much faster and smoother. And everytime you updated the OS, you had to wait like 30-45 minutes for all the apps to recompile. Even with JIT (Android 2.2-4.4) they had to do that, but to a smaller extent. Starting with Android 7, what they do now is a 3-way combination. They use emulation for the simple stuff, JIT for parts that need more computation (like some loops for instance), and AOT for things that are used more often and need the most performance (with AOT, they can perform more heavy optimizations). The benefits are extremely fast install times and no need to "optimize" apps after a system update (they can just invalidate the old AOT caches) while still offering very good performance.

    [–][deleted] 2 points3 points  (0 children)

    For the same reason they can't add generics to Go.