rm of
This commit is contained in:
@@ -79,18 +79,13 @@ log.console("Wota Encode/Decode Benchmark");
|
||||
log.console("===================\n");
|
||||
|
||||
// We'll run each benchmark scenario in turn.
|
||||
for (var bench of benchmarks) {
|
||||
// We'll measure how long it takes to do 'iterations' *for each test value*
|
||||
// in bench.data. The total loop count is `bench.iterations * bench.data)`.
|
||||
// Then we compute an overall encode+decode throughput (ops/s).
|
||||
var totalIterations = bench.iterations * bench.data);
|
||||
arrfor(benchmarks, function(bench) {
|
||||
var totalIterations = bench.iterations * length(bench.data);
|
||||
|
||||
// We'll define a function that does a roundTrip for *each* data item in bench.data
|
||||
// to measure in one loop iteration. Then we multiply by bench.iterations.
|
||||
function runAllData() {
|
||||
for (var val of bench.data) {
|
||||
roundTripWota(val);
|
||||
}
|
||||
arrfor(bench.data, roundTripWota)
|
||||
}
|
||||
|
||||
var elapsedSec = measureTime(runAllData, bench.iterations);
|
||||
@@ -100,7 +95,7 @@ for (var bench of benchmarks) {
|
||||
log.console(` Iterations: ${bench.iterations} × ${length(bench.data)} data items = ${totalIterations}`);
|
||||
log.console(` Elapsed: ${elapsedSec.toFixed(3)} s`);
|
||||
log.console(` Throughput: ${opsPerSec} encode+decode ops/sec\n`);
|
||||
}
|
||||
})
|
||||
|
||||
// All done
|
||||
log.console("Benchmark completed.\n");
|
||||
|
||||
Reference in New Issue
Block a user