Skip to content

Commit 0281e1a

Browse files
committed
Fix benchmark script for testing both old and new version
1 parent 970e902 commit 0281e1a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

benchmark/http_simple.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
path = require("path");
22

33
var puts = require("sys").puts;
4-
http = require("http");
4+
var old = false;
5+
6+
http = require(old ? "http_old" : 'http');
7+
if (old) puts('old version');
58

69
fixed = ""
710
for (var i = 0; i < 20*1024; i++) {
@@ -49,5 +52,6 @@ http.createServer(function (req, res) {
4952
, "Content-Length": content_length
5053
}
5154
);
55+
if (old) res.write(body, 'ascii');
5256
res.close(body, 'ascii');
5357
}).listen(8000);

0 commit comments

Comments
 (0)