AIThis post was created with the assistance of artificial intelligence (AI).

TL;DR

Buying for a business?Offer from Amazon

Get business pricing on monitors, keyboards and dev gear

  • Business-only prices and quantity discounts
  • Tax-exempt purchasing
  • Multiple users, one account, clear invoices
As an affiliate, we earn on qualifying purchases.

A heavily optimized DEFLATE compressor written in Roc, a functional language, ran a median 8.9% slower than the C library libdeflate on an AMD Ryzen 9 3900X and 2.6% slower on an M1 MacBook Pro. The author says the result is specific to one package and benchmark suite; it does not establish how Roc performs across software more broadly.

A DEFLATE compression library written in Roc, a functional programming language, ran within single-digit median percentages of the highly optimized C library libdeflate in tests on two processors, according to a report published October 22. The comparison offers a concrete example of how close a memory-safe functional implementation can come to C in one performance-sensitive task, but it does not show that Roc matches C across software more generally.

The author tested roc-deflate, a package written by Niclas Ahden and used in paid production work, against libdeflate on the Silesia compression corpus. The report says roc-deflate was slower on average across 144 benchmarks. Its median slowdown was 8.9% on an AMD Ryzen 9 3900X running Ubuntu and 2.6% on a 2021 M1 MacBook Pro. The tests covered non-streaming APIs; roc-deflate did not yet support streaming.

Performance varied by input: the report says roc-deflate was as much as 18% slower in its worst cases and slightly more than 18% faster in its best. The author attributed the faster cases to differences between the two implementations and their results on particular inputs, not to a general Roc advantage. The test also checked that the implementations produced identical outputs.

The comparison follows a separate result involving Lean 4: a DEFLATE package called lean-zip reportedly beat Rust’s miniz_oxide at the same compression levels, but remained behind libdeflate. The Roc report presents its own result as a comparison with that C library, which uses architecture-specific SIMD optimizations. Both reports concern particular implementations and workloads, rather than controlled evidence about the performance of entire languages.

At a glance
reportWhen: Reported October 22, 2026; benchmarks r…
The developmentAn October 22 report describes a Roc DEFLATE compressor that approached libdeflate’s performance in tests on two processors.

A Narrow Gap With Safety Trade-offs

The result is relevant to developers weighing runtime speed against memory safety. Roc enforces memory safety, performs automatic reference counting, and checks bounds; the author says its compiler can eliminate some checks and reference-counting work when it proves them unnecessary. C permits direct, unchecked memory access, giving programmers more control but also leaving room for memory errors.

In compression software, those differences matter because implementations process large volumes of data and performance can affect throughput. A Roc implementation close to libdeflate in these tests suggests that safety guarantees do not automatically entail a large speed penalty in every workload. It does not show that Roc can surpass the C library consistently, nor that replacing a mature C dependency with Roc would be faster or safer in every deployment.

The author says C retains a higher performance ceiling because Roc does not let programmers bypass its safety rules. The observed cases where roc-deflate ran faster do not overturn that claim: the report says C could close those individual gaps through further optimization. The practical question is whether a small average slowdown is worthwhile for a project’s safety and maintenance needs.

Amazon

AMD Ryzen 9 3900X desktop processor

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

From Lean Results to Roc Tests

The report was prompted by an article titled “Why Lean is Faster Than Rust,” which described lean-zip outperforming Rust’s miniz_oxide in compression tests. That article also reported that libdeflate remained faster than lean-zip, citing its careful tuning and use of architecture-specific SIMD. The Roc author then chose to compare roc-deflate with libdeflate, while noting that the Roc package and language are still early in development.

Roc’s stated priorities include both fast execution and fast compilation. According to the report, Roc had not reached its first numbered release, version 0.1.0, at the time of the tests, and the package ecosystem had seen little optimization work. The author described this experiment as the most optimization effort applied to a Roc package to date, a caveat that limits what can be inferred about typical Roc code.

Amazon

Apple 2021 MacBook Pro M1

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

How Far the Result Generalizes

The comparison covers one compression package, a specific corpus, two processors, and non-streaming APIs. The report does not provide evidence that similarly small performance gaps will appear in other algorithms, applications, hardware, or production conditions. It also does not establish how roc-deflate compares on streaming workloads, which it had not implemented.

The source does not give a broader sample of optimized Roc programs or a systematic comparison across multiple compilers and C implementations. It describes the benchmark results and checks output equivalence, but the figures should be read as the report’s measurements, not as an independent language-wide performance assessment. How the gap changes with further optimization remains unknown.

Amazon

DEFLATE compression benchmark software development books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

More Roc Workloads Needed

The report’s author says the next meaningful test is to optimize a wider range of real-world Roc codebases. Further work on roc-deflate, including adding streaming support, could also provide comparisons beyond the non-streaming tests described here. No date for additional benchmarks or a numbered Roc release was given.

For now, the result is a benchmark milestone, not a general verdict: Roc came close to a tuned C compressor in the measured cases, while libdeflate remained faster at the median on both machines. Broader testing will be needed to show whether that balance holds across other software and workloads.

Amazon

C programming language systems programming books

As an affiliate, we earn on qualifying purchases.

As an affiliate, we earn on qualifying purchases.

Key Questions

What did the Roc benchmark find?

The report says roc-deflate was a median 8.9% slower than libdeflate on an AMD Ryzen 9 3900X and 2.6% slower on an M1 MacBook Pro, across 144 benchmarks on the Silesia corpus.

Did Roc beat libdeflate?

Not on average. Roc-deflate was faster on some inputs and slower on others, but libdeflate was ahead at the median on both tested machines.

Does this prove Roc is as fast as C?

No. It is a result for one optimized compression package, a particular benchmark corpus, two processors, and non-streaming APIs. The report says C retains a higher performance ceiling.

What safety differences does the report describe?

The author says Roc enforces memory safety, bounds checks, and automatic reference counting, without a language feature for opting out. C permits unchecked memory operations, which can offer more control but carry memory-safety risks.

Source: hn

HALLOWEEN

Halloween Picks

As an affiliate, we earn on qualifying purchases.

You May Also Like

Iosevka Is An Open-source, Sans-serif And Slab-serif Monospace Font

Iosevka is an open-source typeface family with monospace, slab-serif and quasi-proportional variants for coding, terminals and documents.

The Boundaries Of Claude’s Formal Verification, Explained

Anthropic and Theorem report Rocq-checked proofs for 239 fuzz-test entry points, while stressing the limits of the results.

Hugging Face And TorchTPU: Bringing AI Closer To TPU Hardware

TorchTPU brings TPU device support to Hugging Face’s Transformers, Diffusers and Kernels workflows, with performance claims that remain vendor-reported.

What A Clock-Driven Close Looks Like In “Nightmarket — Mercado De Medianoche”

A ThorstenMeyerAI.com field guide describes how time-driven visual changes make a digital night market appear to wind down.