commit | e2903617856920ba01fa8266847b6f0608a43490 | [log] [tgz] |
---|---|---|
author | ichxxx <chen@ichxxx.cn> | Mon Dec 20 12:02:02 2021 +0000 |
committer | Ian Lance Taylor <iant@golang.org> | Tue Dec 21 22:30:16 2021 +0000 |
tree | 84b7d044bffb0477de1ca00d8e01c1ee9fd5de65 | |
parent | 5559a165f5d714f5e4d79f6f3551666d6ceddf24 [diff] |
slices: improve the performance of Equal Although it does an additional index operation, but it avoids the value copy of the range loop, and it will has a better performance if E is a large structure. Compares two int slices, the slices length are 10: name old time/op new time/op delta Equal_WithIntSlices 5.80ns ± 0% 5.80ns ± 1% ~ (p=0.889 n=14+15) Compares two string slices, the slices length are 10: name old time/op new time/op delta Equal_WithStringSlices 17.6ns ± 1% 16.6ns ± 0% -5.61% (p=0.000 n=15+15) Compares two runtime.MemStats slices, the slices length are 10: name old time/op new time/op delta Equal_WithLagerStructSlices 4.46µs ± 0% 1.53µs ± 1% -65.67% (p=0.000 n=15+15) Change-Id: I654b4fd4d7c6c3e233e8ee963e0c510e185d398b GitHub-Last-Rev: 274949314fd4fdfe9074d28ab959caaeb83567cb GitHub-Pull-Request: golang/exp#24 Reviewed-on: https://go-review.googlesource.com/c/exp/+/373394 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org>
This subrepository holds experimental and deprecated (in the old
directory) packages.
The idea for this subrepository originated as the pkg/exp
directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get
these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.