Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
benchmark: missing process.exit after bench.end
Previously bench.end would call process.exit(0) however this is rather
confusing and indeed a few benchmarks had code that assumed otherwise.

This adds process.exit(0) to the benchmarks that needs it.
  • Loading branch information
AndreasMadsen authored and mscdex committed Jul 12, 2016
commit daae7d7de7846349f919accd8c6778c89f8a338a
1 change: 1 addition & 0 deletions benchmark/dgram/array-vs-concat.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function server() {
var bytes = sent * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});

Expand Down
1 change: 1 addition & 0 deletions benchmark/dgram/multi-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});

Expand Down
1 change: 1 addition & 0 deletions benchmark/dgram/offset-length.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});

Expand Down
1 change: 1 addition & 0 deletions benchmark/dgram/single-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});

Expand Down
1 change: 1 addition & 0 deletions benchmark/fs/readfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ function main(conf) {
setTimeout(function() {
bench.end(reads);
try { fs.unlinkSync(filename); } catch (e) {}
process.exit(0);
}, +conf.dur * 1000);

function read() {
Expand Down
1 change: 1 addition & 0 deletions benchmark/http/_chunky_http_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ function main(conf) {
count += 1;
if (count === num) {
bench.end(count);
process.exit(0);
} else {
WriteHTTPHeaders(socket, 1, min + size);
}
Expand Down
1 change: 1 addition & 0 deletions benchmark/http/client-request-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ function main(conf) {

function done() {
bench.end(nreqs);
process.exit(0);
}
}
1 change: 1 addition & 0 deletions benchmark/net/net-c2s-cork.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function server() {
var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);

function send() {
Expand Down
1 change: 1 addition & 0 deletions benchmark/net/net-c2s.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function server() {
var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
Expand Down
1 change: 1 addition & 0 deletions benchmark/net/net-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ function server() {
var bytes = writer.received * 2;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
Expand Down
1 change: 1 addition & 0 deletions benchmark/net/net-s2c.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ function server() {
var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits);
process.exit(0);
}, dur * 1000);
});
});
Expand Down
1 change: 1 addition & 0 deletions benchmark/net/tcp-raw-c2s.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ function server() {
setTimeout(function() {
// report in Gb/sec
bench.end((bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000);

clientHandle.onread = function(nread, buffer) {
Expand Down
1 change: 1 addition & 0 deletions benchmark/net/tcp-raw-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ function client() {
// multiply by 2 since we're sending it first one way
// then then back again.
bench.end(2 * (bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000);

while (clientHandle.writeQueueSize === 0)
Expand Down
1 change: 1 addition & 0 deletions benchmark/net/tcp-raw-s2c.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ function client() {
setTimeout(function() {
// report in Gb/sec
bench.end((bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000);
};
}
1 change: 1 addition & 0 deletions benchmark/tls/tls-connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ function done() {
// don't always match. Generally, serverConn will be
// the smaller number, but take the min just to be sure.
bench.end(Math.min(serverConn, clientConn));
process.exit(0);
}