4 ms·
Is there a solution when the binaries are 500mb+ per platform?
by fire_lake 2y ago
Is there a solution when the binaries are 500mb+ per platform?
- pjmlp 2y agoPeople seem pretty happy when Go and Rust do the same with static linking, advocating how great it happens to be.
- cesarb 2y agoStatic linking in Go and Rust includes compiled code only for the target platform. It does not include compiled code for every possible architecture, including 32-bit MacOS and Solaris on PowerPC.
- SJC_Hacker 2y agoSolaris... now thats a name I have not heard in a long time. A long time.
- pjmlp 2y agoHence why you end up with 300MB x platforms, and tricks like upx.
- yw3410 2y agoYou can't be as aggressive at removing functions in Java than in Rust though since it's dynamic dispatch (e.g., if you use toString once in your code, you need to keep all implementations of toString which are reachable even if users don't use reflection).
- neonsunset 2y ago.NET's trimmer/linker deals with this quite well, only referenced or otherwise observable .ToString() implementations are rooted. Without it 1.6-2MiB-sized AOT binaries would not have been possible (most space is occupied by standard library/runtime bits and GC)
- pjmlp 2y agoExcept that is what jlinker, and GraalVM/OpenJ9 (among other AOT toolchains) do in practice.
- fire_lake 2y agoIn Java libraries are shared precompiled so the package manager either needs to be platform aware or distribute fat bundles.
- pjmlp 2y agoOnly for those that are yet to learn how to use jlinker.
- mike_hearn 2y agoLibraries like JCEF have support tools to download the libraries either at runtime or during the build, to offload from Maven Central.