Skip to content

Commit 63607f3

Browse files
author
Brian Vaughn
committed
Added support for filtering benchmarks
1 parent aa32ee0 commit 63607f3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

benchmarks/regression-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ fs.readFile('books.json', 'utf8',
1717
(err, data) => setupBenchmarks(JSON.parse(data).books)
1818
);
1919

20+
var filter = process.argv.length === 3
21+
? new RegExp(process.argv[2])
22+
: null;
23+
2024
var benchmarks = [];
2125

2226
function setupBenchmarks(corpus) {
@@ -67,6 +71,14 @@ function initBenchmark({
6771
indexStrategy,
6872
searchIndex
6973
}) {
74+
if (
75+
filter &&
76+
!indexStrategy.match(filter) &&
77+
!searchIndex.match(filter)
78+
) {
79+
return;
80+
}
81+
7082
console.log(`Initializing benchmark\t${indexStrategy}\t${searchIndex}`);
7183

7284
initBenchmarkForCreateIndex({

0 commit comments

Comments
 (0)