Roc's Pure-Functional DEFLATE Lands 2.6 to 8.9 Percent Behind C's libdeflate
Software / news
Roc's Pure-Functional DEFLATE Lands 2.6 to 8.9 Percent Behind C's libdeflate
Richard Feldman's own 144-benchmark run on two machines found a worst case of about 18 percent slower and a best case of just over 18 percent faster, before Roc has a numbered release.

A pure-Roc DEFLATE package ran a median 8.9 percent slower than the C library libdeflate on an AMD Ryzen 9 3900X and 2.6 percent slower on an M1 MacBook Pro, according to a benchmark post published Oct. 22 by Roc contributor Richard Feldman.
The figures are the author's own, from a run he describes himself, and no independent party is named as having reproduced them.
What was measured
Feldman optimized roc-deflate, a package written entirely in Roc by Niclas Ahden, and compared it with libdeflate, an MIT-licensed C library for whole-buffer DEFLATE, zlib and gzip compression. The libdeflate README lists compression levels 1 to 12, with the upper levels adding an optimal-parsing algorithm, and says it picks optimized code at run time through CPU feature detection.
The test set was 144 benchmarks: 12 files from the Silesia corpus across levels 1 to 12, non-streaming APIs only. Feldman said the outputs from the two libraries were identical.
- Ryzen 9 3900X8.9 %
- M1 MacBook Pro2.6 %
Source: Richard Feldman, How close can pure FP get to C?, Oct. 22, 2026
The spread is wide. The worst case was about 18 percent slower than libdeflate, and the best was slightly over 18 percent faster. One chart in the post, level 1 on the nci file over 15 runs, gives libdeflate 601.03 MB/s and roc-deflate 529.49 MB/s. A seven-run chart on the same level and file gives 387.30 MB/s for libdeflate and 428.60 MB/s for roc-deflate, which puts Roc ahead.
That second pair is why the median matters more than any single bar. The post's text does not tie each chart to a machine, so the two level-1 pairs are best read as an example of the swing, not as a result for either CPU.
The guarantees Roc keeps
Roc is a functional language with automatic memory management and bounds checks. Feldman wrote that "C's performance ceiling is higher than Roc's," and argued the guarantees justify the cost: memory safety, purity, no foreign function interface, and deterministic behavior across targets.
The techniques he lists are plain: avoiding unnecessary sharing of values, hoisting bounds checks out of loops, building lookup tables at compile time and using wrapping arithmetic.
He also cautions that the result may not generalize, since this is the most optimization effort any Roc package has received so far.
A numbered release is weeks away
Roc has not shipped a numbered release. Feldman wrote that 0.1.0 is "weeks away" and that the compiler is a new implementation with a nascent package ecosystem.
His earlier article, which the post summarizes, found that the Lean 4 package lean-zip beat Rust's miniz_oxide at every level, running 15 percent faster at its fastest setting with output 8.8 percent smaller.
Other software-desk benchmark stories on the site include the Postgres recovery_prefetch write stall and Cloudflare's own numbers on its security-audit skill. The date to watch is the Roc 0.1.0 release, which Feldman has not given.
Sources
More in Software
- 01Fyra Labs Says Tov's Faster-Than-Rust Benchmarks Compare Against Slowed RustTov's own README table now shows Rust ahead on four of 12 tests, and a rival's rewrite of the Rust code erased the dispatch and hash-map leads.
- 02Google's Privacy Policy Now Lets Opted-In Gmail Data Reach Ad ServicesThe Oct. 16 revision keeps the promise of no ads from Gmail content but adds an exception for anyone who connects the inbox to Search through Personal Intelligence.
- 03UUIDv7 Guarantees Uniqueness and Little Else, and Python 3.14's Generator Kept Running Ahead of a Reset ClockRobert Alexander's Oct. 19 post sets RFC 9562's own wording against the ordering, timestamp and unguessability assumptions developers make.
- 04Postgres recovery_prefetch Stalled Writes for Over 30 Minutes in a Synchronous-Replication TestJeremy Schneider's Oct. 20 reproduction kills a standby's walreceiver on a 500-IOPS replica; with prefetch off, the same update applied in under 10 minutes.