Skip to content

Commit

Permalink
tpl/collections: Add BenchmarkWhereMap
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Jan 13, 2025
1 parent a2a4166 commit 956f915
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tpl/collections/where_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -902,3 +902,19 @@ func BenchmarkWhereOps(b *testing.B) {
}
})
}

func BenchmarkWhereMap(b *testing.B) {
ns := newNs()
seq := map[string]string{}

for i := 0; i < 1000; i++ {
seq[fmt.Sprintf("key%d", i)] = "value"
}

for i := 0; i < b.N; i++ {
_, err := ns.Where(context.Background(), seq, "key", "eq", "value")
if err != nil {
b.Fatal(err)
}
}
}

0 comments on commit 956f915

Please sign in to comment.