Roc-based DEFLATE package closes performance gap with C's libdeflate
A developer spent time optimizing roc-deflate, a DEFLATE compression package for the Roc functional programming language written by Niclas Ahden, aiming to see how close it could get to the performance of libdeflate, the C library widely regarded as the fastest DEFLATE implementation. The effort followed an earlier result showing a Lean 4 library, lean-zip, beating Rust's popular miniz_oxide package but still falling well short of libdeflate, which uses hand-tuned, architecture-specific SIMD code. Testing used the non-streaming APIs and the Silesia corpus, since roc-deflate does not yet support streaming.
GoKawiil's interpretation of the reporting above, not reported fact.
The comparisons suggest that functional languages like Lean and Roc, not traditionally associated with systems-level performance, may be narrowing the gap with highly optimized C and Rust implementations in at least some workloads. Because Roc is still pre-1.0 and its package ecosystem largely unoptimized, the author frames this as an early feasibility test rather than a definitive benchmark. The result could matter to developers evaluating whether newer functional languages can realistically compete on performance-critical tasks like compression.
- lean-zip, a Lean 4 DEFLATE library, outperformed Rust's miniz_oxide in speed and compression ratio but trailed C's libdeflate.
- An author optimized roc-deflate, a Roc-language DEFLATE package by Niclas Ahden, to test how close it could get to libdeflate's performance.
- Testing focused on non-streaming APIs using the Silesia corpus, as Roc is pre-1.0 and roc-deflate lacks streaming support.
Source: rtfeldman.com, 2026-10-24
Published there as: “How close can pure functional programming get to C?”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.