testing: Revise usage of b.N and b.Loop() in benchmarks

This commit is contained in:
Bjørn Erik Pedersen
2025-11-06 16:22:02 +01:00
parent 91eac9e573
commit 4c7a78f5ca
20 changed files with 128 additions and 736 deletions
+1
View File
@@ -63,6 +63,7 @@ func TestLexicographicSort(t *testing.T) {
c.Assert(s, qt.DeepEquals, []string{"A", "b", "Ba", "ba", "ba", "Bz"})
}
// // Note that this cannot use b.Loop() because of golang/go#27217.
func BenchmarkStringSort(b *testing.B) {
prototype := []string{"b", "Bz", "zz", "ba", "αβδ αβδ αβδ", "A", "Ba", "ba", "nnnnasdfnnn", "AAgæåz", "αβδC"}
b.Run("LessStrings", func(b *testing.B) {