Skip to content

Commit 7522d2d

Browse files
committed
Add additional cases to benchmark
* Fix a few syntax errors in jmespath expressions * Add a case for repeated function application
1 parent 70b9001 commit 7522d2d

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

tests/benchmarks.json

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,36 @@
3232
}
3333
}
3434
}
35+
},
36+
"b": true,
37+
"c": {
38+
"d": true
3539
}
3640
},
3741
"cases": [
3842
{
3943
"comment": "simple field",
40-
"expression": "a",
44+
"expression": "b",
4145
"bench": "full"
4246
},
4347
{
4448
"comment": "simple subexpression",
45-
"expression": "a.b",
49+
"expression": "c.d",
4650
"bench": "full"
4751
},
4852
{
49-
"comment": "deep field selection",
53+
"comment": "deep field selection no match",
5054
"expression": "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p.q.r.s",
5155
"bench": "full"
5256
},
57+
{
58+
"comment": "deep field selection",
59+
"expression": "a.b.c.d.e.f.g.h.i.j.k.l.m.n.o.p",
60+
"bench": "full"
61+
},
5362
{
5463
"comment": "simple or",
55-
"expression": "not_there || a",
64+
"expression": "not_there || b",
5665
"bench": "full"
5766
}
5867
]
@@ -76,7 +85,12 @@
7685
},
7786
{
7887
"comment": "lots of summing",
79-
"expression": "sum(z, y, x, w, v, u, t, s, r, q, p, o, n, m, l, k, j, i, h, g, f, e, d, c, b, a)",
88+
"expression": "sum([z, y, x, w, v, u, t, s, r, q, p, o, n, m, l, k, j, i, h, g, f, e, d, c, b, a])",
89+
"bench": "full"
90+
},
91+
{
92+
"comment": "lots of function application",
93+
"expression": "sum([z, sum([y, sum([x, sum([w, sum([v, sum([u, sum([t, sum([s, sum([r, sum([q, sum([p, sum([o, sum([n, sum([m, sum([l, sum([k, sum([j, sum([i, sum([h, sum([g, sum([f, sum([e, sum([d, sum([c, sum([b, a])])])])])])])])])])])])])])])])])])])])])])])])])",
8094
"bench": "full"
8195
},
8296
{
@@ -116,7 +130,7 @@
116130
},
117131
{
118132
"comment": "filter projection",
119-
"expression": "foo[bar > baz][qux > baz]",
133+
"expression": "foo[?bar > baz][?qux > baz]",
120134
"bench": "parse"
121135
}
122136
]

0 commit comments

Comments
 (0)