diff options
| author | Mateusz Poliwczak <mpoliwczak34@gmail.com> | 2025-04-07 15:21:16 +0200 |
|---|---|---|
| committer | Michael Pratt <mpratt@google.com> | 2025-04-22 11:01:05 -0700 |
| commit | 8a85a2e70a97773ac96e899df7411eda4f5da2cb (patch) | |
| tree | a19b6a321fef0af68fc2c30e28cd276df12c43da /src/cmd/link/internal | |
| parent | 7d0cb2a2adec493b8ad9d79ef35354c8e20f0213 (diff) | |
| download | go-8a85a2e70a97773ac96e899df7411eda4f5da2cb.tar.xz | |
runtime, internal/runtime/maps: speed-up empty/zero map lookups
This lets the inliner do a better job optimizing the mapKeyError call.
goos: linux
goarch: amd64
pkg: runtime
cpu: AMD Ryzen 5 4600G with Radeon Graphics
│ /tmp/before2 │ /tmp/after3 │
│ sec/op │ sec/op vs base │
MapAccessZero/Key=int64-12 1.875n ± 0% 1.875n ± 0% ~ (p=0.506 n=25)
MapAccessZero/Key=int32-12 1.875n ± 0% 1.875n ± 0% ~ (p=0.082 n=25)
MapAccessZero/Key=string-12 1.902n ± 1% 1.902n ± 1% ~ (p=0.256 n=25)
MapAccessZero/Key=mediumType-12 2.816n ± 0% 1.958n ± 0% -30.47% (p=0.000 n=25)
MapAccessZero/Key=bigType-12 2.815n ± 0% 1.935n ± 0% -31.26% (p=0.000 n=25)
MapAccessEmpty/Key=int64-12 1.942n ± 0% 2.109n ± 0% +8.60% (p=0.000 n=25)
MapAccessEmpty/Key=int32-12 2.110n ± 0% 1.940n ± 0% -8.06% (p=0.000 n=25)
MapAccessEmpty/Key=string-12 2.024n ± 0% 2.109n ± 0% +4.20% (p=0.000 n=25)
MapAccessEmpty/Key=mediumType-12 3.157n ± 0% 2.344n ± 0% -25.75% (p=0.000 n=25)
MapAccessEmpty/Key=bigType-12 3.054n ± 0% 2.115n ± 0% -30.75% (p=0.000 n=25)
geomean 2.305n 2.011n -12.75%
Change-Id: Iee83930884dc4c8a791a711aa189a1c93b68d536
Reviewed-on: https://go-review.googlesource.com/c/go/+/663495
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/cmd/link/internal')
| -rw-r--r-- | src/cmd/link/internal/loader/loader.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index d4605ae6f7..6a7057b80e 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -2359,8 +2359,8 @@ var blockedLinknames = map[string][]string{ "crypto/internal/sysrand.fatal": {"crypto/internal/sysrand"}, "crypto/rand.fatal": {"crypto/rand"}, "internal/runtime/maps.errNilAssign": {"internal/runtime/maps"}, + "internal/runtime/maps.typeString": {"internal/runtime/maps"}, "internal/runtime/maps.fatal": {"internal/runtime/maps"}, - "internal/runtime/maps.mapKeyError": {"internal/runtime/maps"}, "internal/runtime/maps.newarray": {"internal/runtime/maps"}, "internal/runtime/maps.newobject": {"internal/runtime/maps"}, "internal/runtime/maps.typedmemclr": {"internal/runtime/maps"}, |
