e1c3b8a490
For Comparable, we can just use the compiler-generated hash function without using reflection. This results in some performance improvement: │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ Comparable/int64-8 7.956n ± 0% 3.816n ± 3% -52.03% (p=0.000 n=10) Comparable/uint64-8 8.227n ± 1% 3.814n ± 0% -53.64% (p=0.000 n=10) Comparable/uintptr-8 7.959n ± 0% 3.814n ± 1% -52.08% (p=0.000 n=10) Comparable/interface_{}-8 17.480n ± 1% 5.574n ± 0% -68.11% (p=0.000 n=10) Comparable/string-8 27.520n ± 6% 3.714n ± 4% -86.50% (p=0.000 n=10) Comparable/bool-8 8.759n ± 2% 3.978n ± 0% -54.58% (p=0.000 n=10) Comparable/*float64-8 7.956n ± 0% 3.815n ± 0% -52.06% (p=0.000 n=10) Comparable/float64-8 23.555n ± 1% 4.247n ± 4% -81.97% (p=0.000 n=10) Comparable/complex128-8 26.73n ± 0% 10.00n ± 0% -62.58% (p=0.000 n=10) Comparable/struct_{}-8 6.367n ± 2% 2.123n ± 0% -66.66% (p=0.000 n=10) Comparable/maphash.testStruct-8 135.60n ± 2% 15.78n ± 0% -88.36% (p=0.000 n=10) geomean 15.13n 4.702n -68.92% Change-Id: Ie86e6d7876cf8bf44ccfbd90f64480e14451bbf8 Reviewed-on: https://go-review.googlesource.com/c/go/+/630415 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
go.env | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
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 4.0 Attribution 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.
Download and Install
Binary Distributions
Official binary distributions are available at https://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.