Browse Source

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.

PR-URL: https://github.com/nodejs/node/pull/7094
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
v7.x
Andreas Madsen 9 years ago
parent
commit
8bb59fdb12
  1. 1
      benchmark/dgram/array-vs-concat.js
  2. 1
      benchmark/dgram/multi-buffer.js
  3. 1
      benchmark/dgram/offset-length.js
  4. 1
      benchmark/dgram/single-buffer.js
  5. 1
      benchmark/fs/readfile.js
  6. 1
      benchmark/http/_chunky_http_client.js
  7. 1
      benchmark/http/client-request-body.js
  8. 1
      benchmark/net/net-c2s-cork.js
  9. 1
      benchmark/net/net-c2s.js
  10. 1
      benchmark/net/net-pipe.js
  11. 1
      benchmark/net/net-s2c.js
  12. 1
      benchmark/net/tcp-raw-c2s.js
  13. 1
      benchmark/net/tcp-raw-pipe.js
  14. 1
      benchmark/net/tcp-raw-s2c.js
  15. 1
      benchmark/tls/tls-connect.js

1
benchmark/dgram/array-vs-concat.js

@ -67,6 +67,7 @@ function server() {
var bytes = sent * len; var bytes = sent * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });

1
benchmark/dgram/multi-buffer.js

@ -58,6 +58,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * len; var bytes = (type === 'send' ? sent : received) * len;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });

1
benchmark/dgram/offset-length.js

@ -50,6 +50,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * chunk.length; var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });

1
benchmark/dgram/single-buffer.js

@ -50,6 +50,7 @@ function server() {
var bytes = (type === 'send' ? sent : received) * chunk.length; var bytes = (type === 'send' ? sent : received) * chunk.length;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });

1
benchmark/fs/readfile.js

@ -26,6 +26,7 @@ function main(conf) {
setTimeout(function() { setTimeout(function() {
bench.end(reads); bench.end(reads);
try { fs.unlinkSync(filename); } catch (e) {} try { fs.unlinkSync(filename); } catch (e) {}
process.exit(0);
}, +conf.dur * 1000); }, +conf.dur * 1000);
function read() { function read() {

1
benchmark/http/_chunky_http_client.js

@ -81,6 +81,7 @@ function main(conf) {
count += 1; count += 1;
if (count === num) { if (count === num) {
bench.end(count); bench.end(count);
process.exit(0);
} else { } else {
WriteHTTPHeaders(socket, 1, min + size); WriteHTTPHeaders(socket, 1, min + size);
} }

1
benchmark/http/client-request-body.js

@ -65,5 +65,6 @@ function main(conf) {
function done() { function done() {
bench.end(nreqs); bench.end(nreqs);
process.exit(0);
} }
} }

1
benchmark/net/net-c2s-cork.js

@ -84,6 +84,7 @@ function server() {
var bytes = writer.received; var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
function send() { function send() {

1
benchmark/net/net-c2s.js

@ -106,6 +106,7 @@ function server() {
var bytes = writer.received; var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });
}); });

1
benchmark/net/net-pipe.js

@ -109,6 +109,7 @@ function server() {
var bytes = writer.received * 2; var bytes = writer.received * 2;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });
}); });

1
benchmark/net/net-s2c.js

@ -106,6 +106,7 @@ function server() {
var bytes = writer.received; var bytes = writer.received;
var gbits = (bytes * 8) / (1024 * 1024 * 1024); var gbits = (bytes * 8) / (1024 * 1024 * 1024);
bench.end(gbits); bench.end(gbits);
process.exit(0);
}, dur * 1000); }, dur * 1000);
}); });
}); });

1
benchmark/net/tcp-raw-c2s.js

@ -56,6 +56,7 @@ function server() {
setTimeout(function() { setTimeout(function() {
// report in Gb/sec // report in Gb/sec
bench.end((bytes * 8) / (1024 * 1024 * 1024)); bench.end((bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000); }, dur * 1000);
clientHandle.onread = function(nread, buffer) { clientHandle.onread = function(nread, buffer) {

1
benchmark/net/tcp-raw-pipe.js

@ -116,6 +116,7 @@ function client() {
// multiply by 2 since we're sending it first one way // multiply by 2 since we're sending it first one way
// then then back again. // then then back again.
bench.end(2 * (bytes * 8) / (1024 * 1024 * 1024)); bench.end(2 * (bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000); }, dur * 1000);
while (clientHandle.writeQueueSize === 0) while (clientHandle.writeQueueSize === 0)

1
benchmark/net/tcp-raw-s2c.js

@ -135,6 +135,7 @@ function client() {
setTimeout(function() { setTimeout(function() {
// report in Gb/sec // report in Gb/sec
bench.end((bytes * 8) / (1024 * 1024 * 1024)); bench.end((bytes * 8) / (1024 * 1024 * 1024));
process.exit(0);
}, dur * 1000); }, dur * 1000);
}; };
} }

1
benchmark/tls/tls-connect.js

@ -61,4 +61,5 @@ function done() {
// don't always match. Generally, serverConn will be // don't always match. Generally, serverConn will be
// the smaller number, but take the min just to be sure. // the smaller number, but take the min just to be sure.
bench.end(Math.min(serverConn, clientConn)); bench.end(Math.min(serverConn, clientConn));
process.exit(0);
} }

Loading…
Cancel
Save