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

Function BenchmarkBinOp

pkg/traceql/ast_execute_test.go:2122–2163  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

2120}
2121
2122func BenchmarkBinOp(b *testing.B) {
2123 ops := []struct {
2124 op BinaryOperation
2125 }{
2126 {
2127 op: BinaryOperation{
2128 Op: OpEqual,
2129 LHS: NewStaticInt(1),
2130 RHS: NewStaticInt(1),
2131 },
2132 },
2133 {
2134 op: BinaryOperation{
2135 Op: OpEqual,
2136 LHS: NewStaticFloat(1),
2137 RHS: NewStaticInt(1),
2138 },
2139 },
2140 {
2141 op: BinaryOperation{
2142 Op: OpEqual,
2143 LHS: NewStaticDuration(1),
2144 RHS: NewStaticFloat(1),
2145 },
2146 },
2147 {
2148 op: BinaryOperation{
2149 Op: OpEqual,
2150 LHS: NewStaticFloat(1),
2151 RHS: NewStaticFloat(1),
2152 },
2153 },
2154 }
2155
2156 for _, o := range ops {
2157 b.Run(o.op.String(), func(b *testing.B) {
2158 for i := 0; i < b.N; i++ {
2159 _, _ = o.op.execute(&mockSpan{})
2160 }
2161 })
2162 }
2163}
2164
2165// BenchmarkUniquespans benchmarks the performance of the uniqueSpans function using
2166// different numbers of spansets and spans.

Callers

nothing calls this directly

Calls 6

NewStaticIntFunction · 0.85
NewStaticFloatFunction · 0.85
NewStaticDurationFunction · 0.85
executeMethod · 0.65
RunMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected