5 ms·
What changes are needed to make Aarch64 support? Java is write it once run it everywhere, the code is generated at runtime and can fully exploit the latest arch
by The_rationalist 6y ago
What changes are needed to make Aarch64 support? Java is write it once run it everywhere, the code is generated at runtime and can fully exploit the latest arch specific extensions like AVX 512 automatically
Edit: is it because they ship a custom jdk and that the jdk is in C++?
- krzyk 6y agoYes, they ship custom JDK (BTW. This is now expected of all Java apps - jlink and lack of JRE since version 11) so they need to ship JDK that is Aarch64
- pjmlp 6y agoEven if it was 100% written in Java (like GraalVM and RikesVM), the JIT, AOT and GC need to be updated for Apple Silicon.
- danieldk 6y agoApple Silicon (as you know) is AArch64. Given that OpenJDK already had AArch64 support (e.g. through years of Linux AArch64 support, but also OpenJDK for iOS) and macOS support, I would bet that it is mostly a matter of making the build infrastructure aware of the macOS + AArch64 combo. It's not like JIT, AOT, etc. need full new ports to Apple Silicon (in fact, the Azul builds were available pretty much immediately after the release of M1).
- pjmlp 6y agoNot quite, it is almost AArch64, plus some additional goodies. Azul uses their own implementation anyway, so whatever they do isn't a reflection of what OpenJDK supports right now.
- rcoveson 6y agoOpenJDK does support AAarch64 for JDK 8 onwards[0]. Available as part of Ubuntu 18.04 as well[1]. I've used it quite a bit, and for the most part it's slightly faster than it was on x86_64 (though how much of this is due to JIT differences as opposed to core performance I can't say). 0. https://hg.openjdk.java.net/aarch64-port/jdk8/ https://hg.openjdk.java.net/aarch64-port/jdk8/ 1. https://packages.ubuntu.com/bionic/arm64/openjdk-8-jdk/filelist https://packages.ubuntu.com/bionic/arm64/openjdk-8-jdk/filel...
- pjmlp 6y agoExcept Apple Silicon is more than just AAarch64, hence Azul and Microsoft contributions. https://www.infoq.com/news/2020/09/microsoft-windows-mac-arm/ https://www.infoq.com/news/2020/09/microsoft-windows-mac-arm...
- danieldk 6y agoThat does not refute the point. M1 uses the AArch64 ISA, so for the initial port, the existing AArch64 support in OpenJDK can just be used. Sure, they can make optimizations now or in the future for ARMv8.6-A or the Neural Engine (if they are ok with going through Apple's framework). But M1 could pretty much use the existing AArch64 code from day 1 and have good performance. (See benchmarks that float around the net where OpenJDK on AWS Graviton is competitive with Intel CPUs.)
- pjmlp 6y agoIt is more than just the CPU. https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2020-June/040330.html https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/...
- rcoveson 6y agoI should have made it clearer; the section of the comment to which I was replying was: > ...so whatever they do isn't a reflection of what OpenJDK supports right now. I just wanted to point out that OpenJDK itself does support the architecture, and has for some time.
- danieldk 6y agoNot quite, it is almost AArch64, plus some additional goodies. It is AArch64, it's not like it's an incompatible ISA. The fact that it has extra platform features does not slow down the initial port. I am also not sure what 'additional goodies' you are referring to, for which specs are available (you can currently only use the neural engine through Apple's framework)? The fact that it's the first CPU (AFAIK) that is ARMv8.6-A?
- pjmlp 6y agoThese goodies, https://github.com/AdoptOpenJDK/openjdk-build/issues/1922 https://github.com/AdoptOpenJDK/openjdk-build/issues/1922
- rcoveson 6y agoI've run IntelliJ on aarch64 using my system jdk11 instead of the bundled one. I ran into issues with two native binaries that come bundled with it: 1. An inotify library for detecting file changes. In this case, IntelliJ detected that it didn't have a binary for my architecture and just let me know it would be slower. Not a big deal. 2. The async profiler[0]. While available for other architectures, only x86_64 binaries are bundled with IntelliJ. And unfortunately, it didn't detect this either; it just quietly failed to work. Hopefully with this patch they've also fixed these issues on linux-aarch64. 0. https://github.com/jvm-profiling-tools/async-profiler https://github.com/jvm-profiling-tools/async-profiler