diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-02-14 17:26:54 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-02-14 17:26:54 -0800 |
commit | bd094103d791fdd53eccd15bbfd1875655ea4a01 (patch) | |
tree | 9cc034986bc7c789d26767c23df4245086a1a8aa /benchmark | |
parent | b11d78b386d7ae5e46d606dd1d738a5c6f5b3406 (diff) | |
download | node-new-bd094103d791fdd53eccd15bbfd1875655ea4a01.tar.gz |
Add script for running V8 benchmarks
Diffstat (limited to 'benchmark')
-rw-r--r-- | benchmark/v8_bench.js | 15 |
1 files changed, 15 insertions, 0 deletions
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'); |