← Wed, Dec 2 digest

Zig gets improved float parser/formatter

read article ↗ hn thread ↗

Zig is adopting a new floating-point parser and formatter based on Russ Cox's fp algorithm, delivering major speedups and smaller binary sizes.

read it The detailed breakdown of performance benchmarks, binary size metrics, and algorithmic design offers genuine low-level systems engineering depth.

summary

Zig has merged a new floating-point formatting and parsing implementation derived from Russ Cox's recent research. The engine is roughly twice as fast as Ryu for formatting and eliminates a severe performance regression when parsing 128-bit floats. It also reduces binary footprints while introducing full-precision output and robust handling of edge cases. Extensive fuzz testing against reference implementations ensures correctness before its integration into the standard library.

key points

  1. Formatting is roughly 2x faster than Ryu and 10-20% faster than Eisel-Lemire.
  2. Fixes a major performance regression in 128-bit float parsing that previously used a slow big-int fallback.
  3. Reduces binary footprint significantly across both small and fast optimization modes for various float types.

who should read it

Systems programmers and developers interested in numerical computing and low-level performance optimization.

discussion warm

consensus

Commenters overwhelmingly praise Russ Cox's foundational research and express appreciation for rigorous hand-crafted systems engineering.

pushback

A brief tangent questions whether Zig's smaller ecosystem will struggle in an AI-driven software development environment.

best comment by mitchellh ↗

Based on Russ Cox's work. I take every opportunity I get to implore people who care about computer science and/or software engineering to read everything Russ Cox writes anywhere and everywhere, but starting on his blog is good: https://research.swtch.com/

It directs readers to Russ Cox's broader body of blog posts as an essential resource for computer science.

Generated by an LLM from the article and thread. Check the sources before relying on it.