(b *testing.B)
| 545 | } |
| 546 | |
| 547 | func Benchmark_groupBy(b *testing.B) { |
| 548 | program, err := expr.Compile(`groupBy(1..100, # % 7)[6]`) |
| 549 | require.NoError(b, err) |
| 550 | |
| 551 | var out any |
| 552 | b.ResetTimer() |
| 553 | for n := 0; n < b.N; n++ { |
| 554 | out, _ = vm.Run(program, nil) |
| 555 | } |
| 556 | b.StopTimer() |
| 557 | |
| 558 | require.Equal(b, 6, out.([]any)[0]) |
| 559 | } |
| 560 | |
| 561 | func Benchmark_reduce(b *testing.B) { |
| 562 | program, err := expr.Compile(`reduce(1..100, # + #acc)`) |