commit | b71ed4edc6a5663caac434f9c2bea47dbc37db15 | [log] [tgz] |
---|---|---|
author | Martin Möhrmann <moehrmann@google.com> | Sat Mar 11 08:48:56 2017 +0100 |
committer | Robert Griesemer <gri@golang.org> | Sun Mar 12 21:37:32 2017 +0000 |
tree | 0714fabf7b55cf3930178178e62887b5cbc12f50 | |
parent | d343478295f8635e60014fa9481ccea04b6c53a8 [diff] |
strconv: fix performance regression in integer formatting on 32bit platforms Some of the changes in CL golang.org/cl/38071/ assumed that / and % could always be combined to use only one DIV instruction. However, this is not the case for 64bit operands on a 32bit platform which use seperate runtime functions to calculate division and modulo. This CL restores the original optimizations that help on 32bit platforms with negligible impact on 64bit platforms. 386: name old time/op new time/op delta FormatInt-2 6.06µs ± 0% 6.02µs ± 0% -0.70% (p=0.000 n=20+20) AppendInt-2 4.98µs ± 0% 4.98µs ± 0% ~ (p=0.747 n=18+18) FormatUint-2 1.93µs ± 0% 1.85µs ± 0% -4.19% (p=0.000 n=20+20) AppendUint-2 1.71µs ± 0% 1.64µs ± 0% -3.68% (p=0.000 n=20+20) amd64: name old time/op new time/op delta FormatInt-2 2.41µs ± 0% 2.41µs ± 0% -0.09% (p=0.010 n=18+18) AppendInt-2 1.77µs ± 0% 1.77µs ± 0% +0.08% (p=0.000 n=18+18) FormatUint-2 653ns ± 1% 653ns ± 0% ~ (p=0.178 n=20+20) AppendUint-2 514ns ± 0% 513ns ± 0% -0.13% (p=0.000 n=20+17) Change-Id: I574a18e54fb41b25fbe51ce696e7a8765abc79a6 Reviewed-on: https://go-review.googlesource.com/38051 Run-TryBot: Martin Möhrmann <moehrmann@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@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 hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use 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.