x/model: add BenchmarkNameDisplay
Also, use range over int in other benchmarks.
This commit is contained in:
parent
f0e6c563e2
commit
f2c17682b0
@ -281,11 +281,22 @@ func TestParseNameAllocs(t *testing.T) {
|
||||
func BenchmarkParseName(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
|
||||
for i := 0; i < b.N; i++ {
|
||||
for range b.N {
|
||||
keep(ParseName("example.com/mistral:7b+Q4_0"))
|
||||
}
|
||||
}
|
||||
|
||||
func BenchmarkNameDisplay(b *testing.B) {
|
||||
b.ReportAllocs()
|
||||
|
||||
r := ParseName("example.com/mistral:7b+Q4_0")
|
||||
b.Run("Short", func(b *testing.B) {
|
||||
for range b.N {
|
||||
keep(r.DisplayShort())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzParseName(f *testing.F) {
|
||||
f.Add("example.com/mistral:7b+Q4_0")
|
||||
f.Add("example.com/mistral:7b+q4_0")
|
||||
|
Loading…
x
Reference in New Issue
Block a user