GitHub - alibaba/fastjson2: 🚄 FASTJSON2 is a Java JSON library with excellent performance.
🚄 FASTJSON2 is a Java JSON library with excellent performance. - alibaba/fastjson2
The article details three methods to call Rust code from Java or Kotlin: JNI, JNR-FFI, and Project Panama.
It uses a double-to-string conversion example, compiles Rust into dynamic libraries, and benchmarks performance with JMH. Java's native method outperforms single JNI calls by 6x, but Rust improves 50% using the Ryu crate and batch array processing reduces overhead.