summaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-08-30 22:39:06 -0700
committerisaacs <i@izs.me>2013-08-31 10:36:44 -0700
commit01f3b468a917ba89c3deab0e5f90e3f37f3dc169 (patch)
treec1d1a6e45767e26313431e3b5197eb6034ecad02 /benchmark
parentfbb963b5d520a70d9c3f2f9ec116d79a0c676f80 (diff)
downloadandroid-node-v8-01f3b468a917ba89c3deab0e5f90e3f37f3dc169.tar.gz
android-node-v8-01f3b468a917ba89c3deab0e5f90e3f37f3dc169.tar.bz2
android-node-v8-01f3b468a917ba89c3deab0e5f90e3f37f3dc169.zip
benchmark: Support passing v8 flags to benchmarks
The better to test --use-strict effects on performance. (Spoiler: it has no measurable effect on performance.)
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/common.js38
1 files changed, 20 insertions, 18 deletions
diff --git a/benchmark/common.js b/benchmark/common.js
index bfbb054875..7cd2dfb6d2 100644
--- a/benchmark/common.js
+++ b/benchmark/common.js
@@ -18,28 +18,30 @@ if (module === require.main) {
var spawn = require('child_process').spawn;
runBenchmarks();
+}
- function runBenchmarks() {
- var test = tests.shift();
- if (!test)
- return;
+function runBenchmarks() {
+ var test = tests.shift();
+ if (!test)
+ return;
- if (test.match(/^[\._]/))
- return process.nextTick(runBenchmarks);
+ if (test.match(/^[\._]/))
+ return process.nextTick(runBenchmarks);
- console.error(type + '/' + test);
- test = path.resolve(dir, test);
+ console.error(type + '/' + test);
+ test = path.resolve(dir, test);
- var child = spawn(process.execPath, [ test ], { stdio: 'inherit' });
- child.on('close', function(code) {
- if (code)
- process.exit(code);
- else {
- console.log('');
- runBenchmarks();
- }
- });
- }
+ var a = process.execArgv || [];
+ a.push(test);
+ var child = spawn(process.execPath, a, { stdio: 'inherit' });
+ child.on('close', function(code) {
+ if (code)
+ process.exit(code);
+ else {
+ console.log('');
+ runBenchmarks();
+ }
+ });
}
exports.createBenchmark = function(fn, options) {