mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 08:00:26 +00:00
benchmark: Support passing v8 flags to benchmarks
The better to test --use-strict effects on performance. (Spoiler: it has no measurable effect on performance.)
This commit is contained in:
parent
fbb963b5d5
commit
01f3b468a9
@ -18,8 +18,9 @@ if (module === require.main) {
|
|||||||
var spawn = require('child_process').spawn;
|
var spawn = require('child_process').spawn;
|
||||||
|
|
||||||
runBenchmarks();
|
runBenchmarks();
|
||||||
|
}
|
||||||
|
|
||||||
function runBenchmarks() {
|
function runBenchmarks() {
|
||||||
var test = tests.shift();
|
var test = tests.shift();
|
||||||
if (!test)
|
if (!test)
|
||||||
return;
|
return;
|
||||||
@ -30,7 +31,9 @@ if (module === require.main) {
|
|||||||
console.error(type + '/' + test);
|
console.error(type + '/' + test);
|
||||||
test = path.resolve(dir, test);
|
test = path.resolve(dir, test);
|
||||||
|
|
||||||
var child = spawn(process.execPath, [ test ], { stdio: 'inherit' });
|
var a = process.execArgv || [];
|
||||||
|
a.push(test);
|
||||||
|
var child = spawn(process.execPath, a, { stdio: 'inherit' });
|
||||||
child.on('close', function(code) {
|
child.on('close', function(code) {
|
||||||
if (code)
|
if (code)
|
||||||
process.exit(code);
|
process.exit(code);
|
||||||
@ -39,7 +42,6 @@ if (module === require.main) {
|
|||||||
runBenchmarks();
|
runBenchmarks();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.createBenchmark = function(fn, options) {
|
exports.createBenchmark = function(fn, options) {
|
||||||
|
Loading…
Reference in New Issue
Block a user