Optimizing Rust Android Dynamic Library Size: Strategies and Results
This article details how the author reduced the size of a Rust‑based Android JNI dynamic library from 495 KB to 95 KB by adjusting compiler optimization levels, enabling LTO, switching panic handling to abort, removing unused strings, applying panic_immediate_abort, and crafting a custom linker script, while providing code snippets and size comparison tables.