commit | f43e012084c4edd381d21c9988638535696775ea | [log] [tgz] |
---|---|---|
author | Rémy Oudompheng <remyoudompheng@gmail.com> | Fri Oct 23 22:23:21 2020 +0200 |
committer | Nigel Tao <nigeltao@golang.org> | Thu Oct 29 22:44:49 2020 +0000 |
tree | 4effd5ebea8e32e27155e84a65d3f3c1e834bc62 | |
parent | 75789880a6693a4a0645f1b5924d1ede87308a63 [diff] |
strconv: make Eisel-Lemire handle long mantissas In many cases, it is not necessary to parse long decimal mantissas entirely to produce the correctly rounded floating-point number. It is enough to parse the short, rounded lower and upper bounds and in most cases they round to the same floating point number because uint64 can hold 19 digits. Previously this case was handled by the extFloat code path (Grisu3 algorithm). name old time/op new time/op delta Atof64Big-4 1.07µs ± 2% 0.11µs ± 2% -89.61% (p=0.000 n=10+9) Atof64RandomLongFloats-4 8.03µs ± 2% 0.14µs ± 7% -98.24% (p=0.000 n=10+10) Atof32RandomLong-4 760ns ± 1% 156ns ± 0% -79.46% (p=0.000 n=10+8) Benchmarks versus extFloat: name old time/op new time/op delta Atof64Big-4 121ns ± 3% 111ns ± 2% -7.93% (p=0.000 n=10+9) Atof64RandomLongFloats-4 144ns ± 1% 142ns ± 7% ~ (p=0.167 n=10+10) Atof32RandomLong-4 129ns ± 1% 156ns ± 0% +21.12% (p=0.000 n=10+8) Change-Id: Id734b8c11e74b49a444fda67ee72870ae9422e60 Reviewed-on: https://go-review.googlesource.com/c/go/+/264677 Trust: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Russ Cox <rsc@golang.org> Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Nigel Tao <nigeltao@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.