aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorJakub Ciolek <jakub@ciolek.dev>2024-11-13 11:34:50 +0100
committerGopher Robot <gobot@golang.org>2025-02-03 08:46:08 -0800
commit691b7ff1c7b92403dc6a5194ccf5e77f65dbb2bb (patch)
tree70cebdb7b133dba283dff6963568988983e632dc /src/encoding
parent52e32ad79e50742f0d793d60eb52caab53a67061 (diff)
downloadgo-691b7ff1c7b92403dc6a5194ccf5e77f65dbb2bb.tar.xz
internal/fuzz: use a lookup table for SnapshotCoverage
Previously, the implementation used bit manipulation to approximate counters to the nearest power of two. Given the 0-255 range of byte, we can precompute values at initialization and use a lookup table, reducing runtime computation. Benchmarks show an 18% performance gain on AMD64 and 5% on ARM64. * net/netip/FuzzParse (n=10, t=60s, state reset per run) * AMD64 (Intel Alder Lake i5-12600k): 17,349,217 -> 20,487,756 execs/s * ARM64 (M3 Pro): 19,606,471 -> 20,657,041 execs/s * compress/gzip/FuzzReader (n=10, t=60s, mature corpus) * AMD64 (Intel Alder Lake i5-12600k): 5,655,956 -> 6,707,035 execs/s Change-Id: If11f7fe866f54c7cd2c5a48e251c027b67980df7 Reviewed-on: https://go-review.googlesource.com/c/go/+/627378 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions