MCPcopy
hub / github.com/grafana/tempo / BenchmarkStringInPredicate

Function BenchmarkStringInPredicate

pkg/parquetquery/predicates_test.go:354–369  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

352}
353
354func BenchmarkStringInPredicate(b *testing.B) {
355 p := NewStringInPredicate([]string{"abc"})
356
357 s := make([]parquet.Value, 1000)
358 for i := 0; i < 1000; i++ {
359 s[i] = parquet.ValueOf(uuid.New().String())
360 }
361
362 b.ResetTimer()
363
364 for i := 0; i < b.N; i++ {
365 for _, ss := range s {
366 p.KeepValue(ss)
367 }
368 }
369}
370
371func BenchmarkRegexInPredicate(b *testing.B) {
372 p, err := NewRegexInPredicate([]string{"abc"})

Callers

nothing calls this directly

Calls 3

NewStringInPredicateFunction · 0.85
KeepValueMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected