5 ms·
You 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
by yw3410 2y ago
You 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.