Update benchmarks with new createChildProcess API
authorRyan Dahl <ry@tinyclouds.org>
Wed, 7 Oct 2009 08:24:50 +0000 (10:24 +0200)
committerRyan Dahl <ry@tinyclouds.org>
Wed, 7 Oct 2009 08:24:50 +0000 (10:24 +0200)
benchmark/process_loop.js
benchmark/run.js

index e338ad3..6f4d07e 100644 (file)
@@ -4,7 +4,7 @@ node.mixin(require("/utils.js"));
 function next (i) {
   if (i <= 0) return;
 
-  var child = node.createChildProcess("echo hello");
+  var child = node.createChildProcess("echo", ["hello"]);
 
   child.addListener("output", function (chunk) {
     if (chunk) print(chunk);
index 869ae55..6379a16 100644 (file)
@@ -9,9 +9,8 @@ var benchmarks = [ "static_http_server.js"
 var benchmark_dir = node.path.dirname(__filename);
 
 function exec (script, callback) {
-  var command = ARGV[0] + " " + node.path.join(benchmark_dir, script);
   var start = new Date();
-  var child = node.createChildProcess(command);
+  var child = node.createChildProcess(ARGV[0], [node.path.join(benchmark_dir, script)]);
   child.addListener("exit", function (code) {
     var elapsed = new Date() - start;
     callback(elapsed, code);