Skip to content

Commit

Permalink
Added benchs
Browse files Browse the repository at this point in the history
  • Loading branch information
ziflex committed Dec 3, 2024
1 parent 1698f47 commit a0ee097
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions pkg/compiler/compiler_bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,53 @@ LET users = [
RETURN u
`)
}

func BenchmarkForSort2(b *testing.B) {
RunBenchmark(b, `
LET users = [
{
active: true,
age: 31,
gender: "m"
},
{
active: true,
age: 29,
gender: "f"
},
{
active: true,
age: 36,
gender: "m"
}
]
FOR u IN users
SORT u.age, u.gender
RETURN u
`)
}

func BenchmarkForSortDesc(b *testing.B) {
RunBenchmark(b, `
LET users = [
{
active: true,
age: 31,
gender: "m"
},
{
active: true,
age: 29,
gender: "f"
},
{
active: true,
age: 36,
gender: "m"
}
]
FOR u IN users
SORT u.age DESC
RETURN u
`)
}

0 comments on commit a0ee097

Please sign in to comment.