From 9f6a35660d4e56d1b9c0922e6c6b9626c3fb25ee Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Tue, 7 Apr 2020 08:01:24 -0400 Subject: [PATCH] [dev.link] cmd/link/internal/loader: speed up Loader.RelocVariant Remove some extra sanity-checking code from the loader's RelocVariant method, since it was yielding a slowdown of 1-2% linking kubernetes hyperkube (once again a reminder that relocation processing is a very performance-sensitive part of the linker). Change-Id: Ifbc0662f3f96c5f54131103ce6f7439ecfb9b9dc Reviewed-on: https://go-review.googlesource.com/c/go/+/227477 Run-TryBot: Than McIntosh TryBot-Result: Gobot Gobot Reviewed-by: Jeremy Faller --- src/cmd/link/internal/loader/loader.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index fdc020dd2a..acce23c0c2 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -2593,9 +2593,6 @@ func (l *Loader) SetRelocVariant(s Sym, ri int, v sym.RelocVariant) { // RelocVariant returns the 'variant' property of a relocation on // some specific symbol. func (l *Loader) RelocVariant(s Sym, ri int) sym.RelocVariant { - if relocs := l.Relocs(s); ri >= relocs.Count() { - panic("invalid relocation ID") - } return l.relocVariant[relocId{s, ri}] } -- 2.48.1