From 7526bab91cbcc3426252fc81351cc169a14bc5cd Mon Sep 17 00:00:00 2001 From: Tim Voronov Date: Fri, 18 Oct 2024 15:59:42 -0400 Subject: [PATCH] Updated benchmarks --- pkg/compiler/compiler_for_test.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/compiler/compiler_for_test.go b/pkg/compiler/compiler_for_test.go index 1f938b13..8e64b4ac 100644 --- a/pkg/compiler/compiler_for_test.go +++ b/pkg/compiler/compiler_for_test.go @@ -282,7 +282,18 @@ func BenchmarkForEmpty(b *testing.B) { func BenchmarkForArray(b *testing.B) { p := compiler.New().MustCompile(` - FOR i IN [1,2,3] + FOR i IN [1,2,3,4,5,6,7,8,9,10] + RETURN i + `) + + for n := 0; n < b.N; n++ { + p.Run(context.Background()) + } +} + +func BenchmarkForRange(b *testing.B) { + p := compiler.New().MustCompile(` + FOR i IN 1..10 RETURN i `) @@ -293,7 +304,7 @@ func BenchmarkForArray(b *testing.B) { func BenchmarkForObject(b *testing.B) { p := compiler.New().MustCompile(` - FOR i IN {a: 'bar', b: 'foo', c: 'qaz'} + FOR i IN {"1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8, "9":9, "10":10} RETURN i `)