Skip to content

Instantly share code, notes, and snippets.

@bnoordhuis
Created January 3, 2013 01:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bnoordhuis/7a3f33b134544130cd3b to your computer and use it in GitHub Desktop.
Save bnoordhuis/7a3f33b134544130cd3b to your computer and use it in GitHub Desktop.
diff --git a/benchmark/http_simple_auto.js b/benchmark/http_simple_auto.js
index f72cc01..c0dffea 100644
--- a/benchmark/http_simple_auto.js
+++ b/benchmark/http_simple_auto.js
@@ -7,6 +7,7 @@
// <target> Target to benchmark, e.g. `bytes/1024` or `buffer/8192`.
//
+var net = require("net");
var path = require("path");
var http = require("http");
var spawn = require("child_process").spawn;
@@ -100,8 +101,12 @@ server.listen(port, function () {
process.argv[n] = url + process.argv[n];
var cp = spawn('ab', process.argv.slice(2));
- cp.stdout.pipe(process.stdout);
- cp.stderr.pipe(process.stderr);
+ var stdout = new net.Socket({fd: 1});
+ var stderr = new net.Socket({fd: 2});
+ stdout.unref();
+ stderr.unref();
+ cp.stdout.pipe(stdout);
+ cp.stderr.pipe(stderr);
cp.on('exit', function() {
server.close();
process.nextTick(dump_mm_stats);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment