aboutsummaryrefslogtreecommitdiff
path: root/src/math/bits/make_tables.go
AgeCommit message (Collapse)Author
2021-03-17math/bits: folded reverse tables by using const stringMeng Zhuo
linux/mips64le name old time/op new time/op delta Reverse 2.31ns ± 1% 2.27ns ± 1% -1.53% (p=0.001 n=10+10) Reverse8 0.65ns ± 1% 0.65ns ± 1% -1.19% (p=0.000 n=9+10) Reverse16 1.15ns ± 2% 1.14ns ± 2% ~ (p=0.062 n=9+10) Reverse32 1.96ns ± 1% 1.94ns ± 1% -1.16% (p=0.000 n=10+9) Reverse64 2.29ns ± 1% 2.26ns ± 0% -0.94% (p=0.000 n=9+9) ReverseBytes 0.66ns ± 3% 0.65ns ± 1% -1.58% (p=0.006 n=9+10) ReverseBytes16 0.66ns ± 2% 0.65ns ± 1% -2.05% (p=0.000 n=10+9) ReverseBytes32 0.41ns ± 1% 0.40ns ± 0% -1.68% (p=0.000 n=10+10) ReverseBytes64 0.66ns ± 1% 0.65ns ± 1% -1.50% (p=0.000 n=10+9) cpu=1 benchtime=100ms count=100 name old time/op new time/op delta Reverse 28.0ns ± 3% 27.7ns ± 3% -0.80% (p=0.000 n=100+98) Reverse8 2.24ns ± 1% 2.24ns ± 1% ~ (p=0.142 n=98+100) Reverse16 4.07ns ± 3% 4.05ns ± 3% -0.66% (p=0.000 n=99+99) Reverse32 11.3ns ± 0% 11.3ns ± 0% ~ (p=0.283 n=94+97) Reverse64 12.6ns ± 0% 12.6ns ± 0% +0.60% (p=0.000 n=100+98) ReverseBytes 5.25ns ± 1% 5.24ns ± 1% -0.18% (p=0.000 n=100+100) ReverseBytes16 2.00ns ± 0% 2.21ns ± 3% +10.07% (p=0.000 n=88+100) ReverseBytes32 4.08ns ± 2% 4.13ns ± 2% +1.39% (p=0.000 n=99+99) ReverseBytes64 5.48ns ± 1% 5.45ns ± 1% -0.50% (p=0.000 n=98+99) Update #43403 Change-Id: I7e7e00bb17608739d9f6b927c6dfef2580493a0e Reviewed-on: https://go-review.googlesource.com/c/go/+/280645 Trust: Meng Zhuo <mzh@golangcn.org> Trust: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
2021-02-20all: go fmt std cmd (but revert vendor)Russ Cox
Make all our package sources use Go 1.17 gofmt format (adding //go:build lines). Part of //go:build change (#41184). See https://golang.org/design/draft-gobuild Change-Id: Ia0534360e4957e58cd9a18429c39d0e32a6addb4 Reviewed-on: https://go-review.googlesource.com/c/go/+/294430 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-12-09all: update to use os.ReadFile, os.WriteFile, os.CreateTemp, os.MkdirTempRuss Cox
As part of #42026, these helpers from io/ioutil were moved to os. (ioutil.TempFile and TempDir became os.CreateTemp and MkdirTemp.) Update the Go tree to use the preferred names. As usual, code compiled with the Go 1.4 bootstrap toolchain and code vendored from other sources is excluded. ReadDir changes are in a separate CL, because they are not a simple search and replace. For #42026. Change-Id: If318df0216d57e95ea0c4093b89f65e5b0ababb3 Reviewed-on: https://go-review.googlesource.com/c/go/+/266365 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-02-28math/bits: faster LeadingZeros and Len functionsRobert Griesemer
benchmark old ns/op new ns/op delta BenchmarkLeadingZeros-8 8.43 3.10 -63.23% BenchmarkLeadingZeros8-8 8.13 1.33 -83.64% BenchmarkLeadingZeros16-8 7.34 2.07 -71.80% BenchmarkLeadingZeros32-8 7.99 2.87 -64.08% BenchmarkLeadingZeros64-8 8.13 2.96 -63.59% Measured on 2.3 GHz Intel Core i7 running macOS 10.12.3. Change-Id: Id343531b408d42ac45f10c76f60e85bdb977f91e Reviewed-on: https://go-review.googlesource.com/37582 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-28math/bits: faster TrailingZeroes8Robert Griesemer
For sizes > 8, the existing code is faster. benchmark old ns/op new ns/op delta BenchmarkTrailingZeros8-8 1.95 1.29 -33.85% Measured on 2.3 GHz Intel Core i7 running macOS 10.12.3. Change-Id: I6f3a33ec633a2c544ec29693c141f2f99335c745 Reviewed-on: https://go-review.googlesource.com/37581 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-28math/bits: faster OnesCount using table lookups for sizes 8,16,32Robert Griesemer
For uint64, the existing algorithm is faster. benchmark old ns/op new ns/op delta BenchmarkOnesCount8-8 1.95 0.97 -50.26% BenchmarkOnesCount16-8 2.54 1.39 -45.28% BenchmarkOnesCount32-8 2.61 1.96 -24.90% Measured on 2.3 GHz Intel Core i7 running macOS 10.12.3. Change-Id: I6cc42882fef3d24694720464039161e339a9ae99 Reviewed-on: https://go-review.googlesource.com/37580 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-25math/bits: faster Reverse8/16 functions using table lookupsRobert Griesemer
Measured on 2.3 GHz Intel Core i7, running macOS 10.12.3: benchmark old ns/op new ns/op delta BenchmarkReverse8-8 1.70 0.99 -41.76% BenchmarkReverse16-8 2.24 1.32 -41.07% Fixes #19279. Change-Id: I398cf8a3513b7fa63c130efc7846a7c5353999d4 Reviewed-on: https://go-review.googlesource.com/37459 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>