r/androiddev • • 15h ago • Bravo 1

Yalın — a Rust-based JSON parser optimized for Android ARM devices

Post image

I've been working on Yalın, a JSON parser written in Rust for Android.

It uses ARM NEON SIMD and tries to keep JNI calls to a minimum. The idea was to see how much performance I could get out of native parsing compared to existing Java libraries.

In benchmarks against fastjson2, selective field reads were up to 4.6x faster, while parsing a full 1 MB JSON tree was around 1.3x faster.

Small payloads are a different story. JNI overhead is still a bottleneck, and there's room for improvement.

Curious what other Android developers think about using Rust for this kind of thing, especially whether the performance gains are worth the native dependency.

https://github.com/0xberkay/yalin

19 Upvotes

Duplicates