Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
bench: Make http easier to profile
Browse files Browse the repository at this point in the history
Do not run the http/simple.js server in a child process.

Fix #4831
  • Loading branch information
isaacs committed Feb 26, 2013
1 parent f80f3c5 commit 88befa6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions benchmark/http/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ var bench = common.createBenchmark(main, {
function main(conf) {
process.env.PORT = PORT;
var spawn = require('child_process').spawn;
var simple = require('path').resolve(__dirname, '../http_simple.js');
var server = spawn(process.execPath, [simple]);
var server = require('../http_simple.js');
setTimeout(function() {
var path = '/' + conf.type + '/' + conf.length; //+ '/' + conf.chunks;
var args = ['-r', 5000, '-t', 8, '-c', conf.c];

bench.http(path, args, function() {
server.kill();
server.close();
});
}, 2000);
}
2 changes: 1 addition & 1 deletion benchmark/http_simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (useDomains) {
gdom.enter();
}

var server = http.createServer(function (req, res) {
var server = module.exports = http.createServer(function (req, res) {
if (useDomains) {
var dom = domain.create();
dom.add(req);
Expand Down

0 comments on commit 88befa6

Please sign in to comment.