]> Cypherpunks repositories - gostls13.git/commit
runtime: don't call span.heapBits in writeHeapBitsSmall
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 18 Sep 2024 01:58:50 +0000 (01:58 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 21 Oct 2024 14:47:04 +0000 (14:47 +0000)
commit56fb8350c835d1ccf0e6cdb8f753c85e2e0748a8
treef2024aa2b47f37cda439a53d6869056c87c1edff
parentd94b7a187685942579e7d7dc00bf58448cdafce8
runtime: don't call span.heapBits in writeHeapBitsSmall

For whatever reason, span.heapBits is kind of slow. It accounts for
about a quarter of the cost of writeHeapBitsSmall, which is absurd. We
get a nice speed improvement for small allocations by eliminating this
call.

                   │   before    │               after               │
                   │   sec/op    │   sec/op     vs base              │
MallocTypeInfo16-4   29.47n ± 1%   27.02n ± 1%  -8.31% (p=0.002 n=6)

Change-Id: I6270e26902e5a9254cf1503fac81c3c799c59d6a
Reviewed-on: https://go-review.googlesource.com/c/go/+/614255
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
src/runtime/malloc.go
src/runtime/mbitmap.go