Browse Source

benchmark: make v8-bench.js output consistent

This changes the way v8-bench.js reports its performance to be consistent
with other benchmarks.

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Andreas Madsen <amwebdk@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/8564
v7.x
Bartosz Sosnowski 8 years ago
committed by James M Snell
parent
commit
dfb5f301cf
  1. 13
      benchmark/misc/v8-bench.js

13
benchmark/misc/v8-bench.js

@ -23,6 +23,7 @@ load('regexp.js');
load('splay.js'); load('splay.js');
load('navier-stokes.js'); load('navier-stokes.js');
const benchmark_name = path.join('misc', 'v8-bench.js');
const times = {}; const times = {};
global.BenchmarkSuite.RunSuites({ global.BenchmarkSuite.RunSuites({
NotifyStart: function(name) { NotifyStart: function(name) {
@ -31,8 +32,10 @@ global.BenchmarkSuite.RunSuites({
NotifyResult: function(name, result) { NotifyResult: function(name, result) {
const elapsed = process.hrtime(times[name]); const elapsed = process.hrtime(times[name]);
common.sendResult({ common.sendResult({
name: name, name: benchmark_name,
conf: {}, conf: {
benchmark: name
},
rate: result, rate: result,
time: elapsed[0] + elapsed[1] / 1e9 time: elapsed[0] + elapsed[1] / 1e9
}); });
@ -42,8 +45,10 @@ global.BenchmarkSuite.RunSuites({
}, },
NotifyScore: function(score) { NotifyScore: function(score) {
common.sendResult({ common.sendResult({
name: 'Score (version ' + global.BenchmarkSuite.version + ')', name: benchmark_name,
conf: {}, conf: {
benchmark: 'Score (version ' + global.BenchmarkSuite.version + ')'
},
rate: score, rate: score,
time: 0 time: 0
}); });

Loading…
Cancel
Save