MCPcopy Create free account
hub / github.com/expr-lang/expr / BenchmarkSumRange_Optimized

Function BenchmarkSumRange_Optimized

optimizer/sum_range_test.go:249–261  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

247}
248
249func BenchmarkSumRange_Optimized(b *testing.B) {
250 program, err := expr.Compile(`sum(1..100)`)
251 require.NoError(b, err)
252
253 var out any
254 b.ResetTimer()
255 for n := 0; n < b.N; n++ {
256 out, _ = expr.Run(program, nil)
257 }
258 b.StopTimer()
259
260 require.Equal(b, 5050, out)
261}
262
263func BenchmarkReduceRangeSum_Optimized(b *testing.B) {
264 program, err := expr.Compile(`reduce(1..100, # + #acc)`)

Callers

nothing calls this directly

Calls 4

CompileFunction · 0.92
NoErrorFunction · 0.92
RunFunction · 0.92
EqualFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…