arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2101.11408cs.DScs.MS
收藏

以每秒100字节的速度进行数字解析

Number Parsing at a Gigabyte per Second

Daniel Lemire

摘要:

随着磁盘和网络提供每秒千兆字节,从字符串中解析十进制数字成为瓶颈。我们考虑将十进制数解析为最接近的二进制浮点值的问题。一般问题需要变精度算法。但是,我们最多需要17位数字来表示64位标准浮点数(IEEE 754)。因此,我们可以用单个64位字来表示十进制有效数。通过结合有效位和预计算表,我们可以使用一个或两个64位乘法来计算最近的浮点数。我们的实现可以比现代64位系统(Intel,AMD,ARM和POWER9)上的标准C库中的传统函数快几倍。我们的工作可以作为开源软件使用,主要系统如Apache Arrow和Yandex ClickHouse。Go标准库采用了我们的方法。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑