update go version so we can use the new benchmarking helper.

This commit is contained in:
fiatjaf
2025-03-13 18:57:28 -03:00
parent 1b610ba318
commit 4dcadd4d88
4 changed files with 6 additions and 29 deletions

View File

@@ -129,26 +129,3 @@ func TestDoWorkTimeout(t *testing.T) {
}
}
}
func BenchmarkDoWork(b *testing.B) {
if testing.Short() {
b.Skip("too consuming for short mode")
}
for _, difficulty := range []int{8, 16, 24} {
difficulty := difficulty
b.Run(fmt.Sprintf("%dbits", difficulty), func(b *testing.B) {
for i := 0; i < b.N; i++ {
event := &nostr.Event{
Kind: nostr.KindTextNote,
Content: "It's just me mining my own business",
PubKey: "a48380f4cfcc1ad5378294fcac36439770f9c878dd880ffa94bb74ea54a6f243",
}
ctx, cancel := context.WithTimeout(context.Background(), time.Second*60)
defer cancel()
if _, err := DoWork(ctx, *event, difficulty); err != nil {
b.Fatal(err)
}
}
})
}
}