HackerPapers

arXiv:2101.11408cs.DS

Number Parsing at a Gigabyte per Second

Daniel Lemire

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

With disks and networks providing gigabytes per second, parsing decimal numbers from strings becomes a bottleneck. We consider the problem of parsing decimal numbers to the nearest binary floating-point value. The general problem requires variable-precision arithmetic. However, we need at most 17 digits to represent 64-bit standard floating-point numbers (IEEE 754). Thus we can represent the decimal significand with a single 64-bit word. By combining the significand and precomputed tables, we can compute the nearest floating-point number using as few as one or two 64-bit multiplications. Our implementation can be several times faster than conventional functions present in standard C libraries on modern 64-bit systems (Intel, AMD, ARM and POWER9). Our work is available as open source software used by major systems such as Apache Arrow and Yandex ClickHouse. The Go standard library has adopted a version of our approach.

arXiv comments
Software at https://github.com/fastfloat/fast_float and https://github.com/lemire/simple_fastfloat_benchmark/
Journal reference
Software: Practice and Experience 51 (8), 2021
DOI
doi:10.1002/spe.2984
Subjects
cs.DSData Structures and Algorithms cs.MSMathematical Software

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Feb 2021 to Feb 2021. Found in 1 HN submission from Nov 2026 to Nov 2026. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments1 thread

    • Here's a more recent blog post: [1] and a published paper on arxiv: [2], describing the latest version of the algorithm which is implemented in fast_float C++ library [3]. Coincidentally, I've participated in this as well recently by implementing the algorithm in Rust…

      aldanorView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.