Skip to content

Commit 7cb3a87

Browse files
committed
benchmark script: all short cut for modes and benchmarks
1 parent cbb9d12 commit 7cb3a87

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

benchmark/bin.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@
44
const Table = require('cli-table');
55
const spawn = require('child_process').spawn;
66
const argv = process.argv.slice(2);
7-
const modes = argv[1].split(',');
8-
const benchmarks = argv[0].split(',');
7+
let benchmarks = argv[0];
8+
9+
let modes = argv[1];
10+
console.log(modes, benchmarks);
11+
if(benchmarks === 'all') benchmarks = ['iris/cross-validation', 'iris/grid-search'];
12+
else benchmarks = benchmarks.split(',');
13+
if(modes === 'all') modes = ['native', 'asm', 'wasm'];
14+
else modes = modes.split(',');
15+
916
const time = +argv[2] || 10;
1017

1118
if(modes.includes('asm') || modes.includes('wasm')) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"serve": "webpack-dev-server",
1717
"test": "mocha --require should --recursive test",
1818
"build-benchmark": "(cd benchmark/iris; make)",
19-
"benchmark": "npm run build-benchmark && node benchmark/bin iris/cross-validation,iris/grid-search native,asm,wasm 5",
19+
"benchmark": "npm run build-benchmark && node benchmark/bin all all 5",
2020
"xyz": "echo $1"
2121
},
2222
"repository": {

0 commit comments

Comments
 (0)