← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Roc Functional Language Achieves Near C-Level Performance in DEFLATE Compression

🔄 Updated 14d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Roc's `roc-deflate` library was benchmarked against C's `libdeflate`.
  • It performed 8.9% slower on AMD Ryzen and 2.6% slower on M1 MacBook Pro.
  • Roc is a functional language focused on runtime performance.
  • Lean 4 previously outperformed Rust's `miniz_oxide` but not `libdeflate`.

Roc's Performance Against C

A DEFLATE compression library, `roc-deflate`, written in the functional programming language Roc, was benchmarked against `libdeflate`, a highly optimized C library. The results showed `roc-deflate` running slower than `libdeflate` by a median of 8.9% on an AMD Ryzen 9 3900X and 2.6% on an M1 MacBook Pro.

This benchmark focused on non-streaming APIs using the Silesia corpus for testing, with verification that identical outputs were produced.

Context and Previous Benchmarks

This effort follows a previous benchmark where Lean 4, another functional language, demonstrated a DEFLATE compression library (`lean-zip`) that outperformed Rust's `miniz_oxide` by being 15% quicker and producing 8.8% smaller output at its fastest setting. However, `lean-zip` did not match the performance of `libdeflate` due to its architecture-specific SIMD optimizations.

Roc, while also functional, is not a theorem prover and explicitly prioritizes runtime performance, with its tagline being "Fast, Friendly, Functional."

Roc's Development Status

Roc is a relatively new language, with its first numbered release (0.1.0) still pending. Its package ecosystem is nascent and has not yet undergone significant optimization work. Despite this, its language design, existing optimizations, and new compiler implementation provided a foundation for this performance comparison.

Implications for Functional Programming

The results indicate that functional programming languages, particularly those designed with performance in mind like Roc, can achieve performance levels very close to highly optimized C implementations for specific computational tasks. This challenges the perception that functional languages inherently incur significant runtime overhead compared to lower-level languages.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

A DEFLATE compression library written in Roc, a functional programming language, achieved performance within 10% of libdeflate, a highly optimized C library. This demonstrates that functional languages can approach the runtime performance of C for specific tasks, challenging traditional assumptions about performance ceilings.