Skip to content

Commit 8935f68

Browse files
committed
Update perf script
1 parent c76895a commit 8935f68

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

perf.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
11
var jmespath = require('./jmespath')
2-
var parser = new jmespath.Parser();
32
var Benchmark = require('benchmark');
43
var suite = new Benchmark.Suite;
54

65
// add tests
76
suite.add('Parser#single_expr', function() {
8-
parser.parse("foo");
7+
jmespath.compile("foo");
98
})
109
.add('Parser#single_subexpr', function() {
11-
parser.parse("foo.bar");
10+
jmespath.compile("foo.bar");
1211
})
1312
.add('Parser#deeply_nested_50', function() {
14-
parser.parse("j49.j48.j47.j46.j45.j44.j43.j42.j41.j40.j39.j38.j37.j36.j35.j34.j33.j32.j31.j30.j29.j28.j27.j26.j25.j24.j23.j22.j21.j20.j19.j18.j17.j16.j15.j14.j13.j12.j11.j10.j9.j8.j7.j6.j5.j4.j3.j2.j1.j0");
13+
jmespath.compile("j49.j48.j47.j46.j45.j44.j43.j42.j41.j40.j39.j38.j37.j36.j35.j34.j33.j32.j31.j30.j29.j28.j27.j26.j25.j24.j23.j22.j21.j20.j19.j18.j17.j16.j15.j14.j13.j12.j11.j10.j9.j8.j7.j6.j5.j4.j3.j2.j1.j0");
1514

1615
})
1716
.add('Parser#deeply_nested_50_index', function() {
18-
parser.parse("[49][48][47][46][45][44][43][42][41][40][39][38][37][36][35][34][33][32][31][30][29][28][27][26][25][24][23][22][21][20][19][18][17][16][15][14][13][12][11][10][9][8][7][6][5][4][3][2][1][0]");
17+
jmespath.compile("[49][48][47][46][45][44][43][42][41][40][39][38][37][36][35][34][33][32][31][30][29][28][27][26][25][24][23][22][21][20][19][18][17][16][15][14][13][12][11][10][9][8][7][6][5][4][3][2][1][0]");
1918
})
2019
.add('Parser#basic_list_projection', function() {
21-
parser.parse("foo[*].bar");
20+
jmespath.compile("foo[*].bar");
2221
})
2322
.on('cycle', function(event) {
2423
var bench = event.target;

0 commit comments

Comments
 (0)