commit | 47ecfdc1ba53b7a217de96a0a51217e210e428b4 | [log] [tgz] |
---|---|---|
author | Egon Elbre <egonelbre@gmail.com> | Thu Apr 20 08:41:23 2023 +0300 |
committer | Gopher Robot <gobot@golang.org> | Tue Apr 25 01:00:34 2023 +0000 |
tree | 5154d3605ca835142233a50d977ae4bcdcaf490c | |
parent | 0ee363d48fb178e6c88093c0b55139cb387f8f74 [diff] |
slices: optimize Index and Compact for large types Using `for i, v := range` loops causes extra copies. Try to get rid of as much copies as possible. │ old.txt~ │ new.txt~ │ │ sec/op │ sec/op vs base │ EqualFunc_Large-32 1.077m ± 1% 1.072m ± 1% ~ (p=0.631 n=10) Index_Large-32 346.329µ ± 1% 6.510µ ± 24% -98.12% (p=0.000 n=10) IndexFunc_Large-32 502.9µ ± 0% 381.2µ ± 1% -24.21% (p=0.000 n=10) Compact_Large-32 409.5µ ± 1% 145.2µ ± 9% -64.54% (p=0.000 n=10) CompactFunc_Large-32 693.5µ ± 1% 663.1µ ± 3% -4.39% (p=0.000 n=10) geomean 556.3µ 191.3µ -65.61% Change-Id: I187065ea32394b241951928bada7a698a9f45cd9 Reviewed-on: https://go-review.googlesource.com/c/exp/+/486735 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
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.