mirror of
https://github.com/golang/go.git
synced 2025-10-19 19:13:18 +00:00
cmd/compile/internal/base: remove BenchmarkParseSpectreNew
This commit is contained in:
parent
4db66ee146
commit
392b315e12
1 changed files with 0 additions and 57 deletions
|
@ -1,57 +0,0 @@
|
||||||
// Copyright 2025 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package base
|
|
||||||
|
|
||||||
import (
|
|
||||||
"cmd/internal/obj"
|
|
||||||
"strings"
|
|
||||||
"testing"
|
|
||||||
)
|
|
||||||
|
|
||||||
func BenchmarkParseSpectreNew(b *testing.B) {
|
|
||||||
if Ctxt == nil {
|
|
||||||
Ctxt = &obj.Link{}
|
|
||||||
}
|
|
||||||
|
|
||||||
testCases := []struct {
|
|
||||||
name string
|
|
||||||
input string
|
|
||||||
}{{
|
|
||||||
name: "empty",
|
|
||||||
input: "",
|
|
||||||
}, {
|
|
||||||
name: "index",
|
|
||||||
input: "index",
|
|
||||||
}, {
|
|
||||||
name: "ret",
|
|
||||||
input: "ret",
|
|
||||||
}, {
|
|
||||||
name: "index_ret",
|
|
||||||
input: "index,ret",
|
|
||||||
}, {
|
|
||||||
name: "all",
|
|
||||||
input: "all",
|
|
||||||
}, {
|
|
||||||
name: "multiple_indices_ret",
|
|
||||||
input: strings.Repeat("index,", 10) + "ret",
|
|
||||||
}}
|
|
||||||
|
|
||||||
for _, tc := range testCases {
|
|
||||||
b.Run(tc.name, func(b *testing.B) {
|
|
||||||
// Reset variables before each run
|
|
||||||
oldFlagCfgSpectreIndex := Flag.Cfg.SpectreIndex
|
|
||||||
oldCtxtRetpoline := Ctxt.Retpoline
|
|
||||||
defer func() {
|
|
||||||
Flag.Cfg.SpectreIndex = oldFlagCfgSpectreIndex
|
|
||||||
Ctxt.Retpoline = oldCtxtRetpoline
|
|
||||||
}()
|
|
||||||
|
|
||||||
b.ResetTimer()
|
|
||||||
for b.Loop() {
|
|
||||||
parseSpectre(tc.input)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue