Computer Science > Data Structures and Algorithms
[Submitted on 11 Jan 2021 (v1), last revised 3 Nov 2022 (this version, v9)]
Title:Number Parsing at a Gigabyte per Second
View PDFAbstract: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.
Submission history
From: Daniel Lemire [view email][v1] Mon, 11 Jan 2021 20:31:27 UTC (103 KB)
[v2] Sat, 30 Jan 2021 23:57:29 UTC (103 KB)
[v3] Wed, 24 Feb 2021 17:17:14 UTC (103 KB)
[v4] Tue, 23 Mar 2021 00:52:54 UTC (100 KB)
[v5] Mon, 29 Nov 2021 18:55:35 UTC (100 KB)
[v6] Sat, 16 Apr 2022 18:47:07 UTC (100 KB)
[v7] Sat, 30 Apr 2022 17:44:34 UTC (100 KB)
[v8] Thu, 29 Sep 2022 16:57:14 UTC (100 KB)
[v9] Thu, 3 Nov 2022 18:40:26 UTC (100 KB)
References & Citations
Bibliographic and Citation Tools
Bibliographic Explorer (What is the Explorer?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)
Code, Data and Media Associated with this Article
alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)
Demos
Recommenders and Search Tools
Influence Flower (What are Influence Flowers?)
Connected Papers (What is Connected Papers?)
CORE Recommender (What is CORE?)
arXivLabs: experimental projects with community collaborators
arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.
Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.
Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.