Files
SpotiFLAC-Mobile/rust_backend/crates/network
zarzet 7fb2433641 build(rust): optimize the backend for size, keep hot code fast
Release builds use opt-level "s" with fat LTO. On Android arm64 the
backend library goes from 20.9 MB to 17.3 MB.

CPU-bound code keeps opt-level 3: the mobile and core crates and the
FLAC and image decoders. At "s" the Direct USB resampler ran six times
slower (251 ms against 40 ms for ten seconds of audio on the build
machine, with the same output) and the cover and Hi-Res tests took
longer (0.09 s against 0.05 s, 0.90 s against 0.76 s). Keeping these
fast costs 0.44 MB.

Dependencies are trimmed: zip inflates with the flate2 backend the
tree already links, rustls-pemfile gives way to the PEM parser of
rustls-pki-types, and regex drops the engines the app can do without.
Its lazy DFA stays for 0.09 MB, as log redaction ran fifty times
slower without it (60 against 1.1 microseconds a line).
2026-11-22 00:21:30 +07:00
..