From bd094103d791fdd53eccd15bbfd1875655ea4a01 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 14 Feb 2011 17:26:54 -0800 Subject: [PATCH] Add script for running V8 benchmarks --- benchmark/v8_bench.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 benchmark/v8_bench.js diff --git a/benchmark/v8_bench.js b/benchmark/v8_bench.js new file mode 100644 index 0000000000..fbd3748ca2 --- /dev/null +++ b/benchmark/v8_bench.js @@ -0,0 +1,15 @@ +// compare with "google-chrome deps/v8/benchmarks/run.html" +var fs = require('fs'); +var path = require('path'); +var vm = require('vm'); + +var dir = path.join(__dirname, '..', 'deps', 'v8', 'benchmarks'); + +global.print = console.log; + +global.load = function (x) { + var source = fs.readFileSync(path.join(dir, x), 'utf8'); + vm.runInThisContext(source, x); +} + +load('run.js');