Permalink
Browse files

Add script for running V8 benchmarks

  • Loading branch information...
1 parent b11d78b commit bd094103d791fdd53eccd15bbfd1875655ea4a01 @ry ry committed Feb 15, 2011
Showing with 15 additions and 0 deletions.
  1. +15 −0 benchmark/v8_bench.js
View
15 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');

0 comments on commit bd09410

Please sign in to comment.