Skip to content

Commit 8305e9e

Browse files
committed
Fix counter in benchmarking program
I changed the semantics of buffer::len() to count the total number of samples, not the number of samples per channel. That of course results in incorrect numbers when multiplied with the channel count, and the quantiles were about half of what was reported for the mean. This commit fixes the benchmark output again.
1 parent 160a3b0 commit 8305e9e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

examples/bench_decode.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ fn decode_file(data: &[u8], sample_times_ns: &mut Vec<f64>) -> (f64, f64) {
6262
// Update timing information.
6363
let now = PreciseTime::now();
6464
let duration_ns = frame_epoch.to(now).num_nanoseconds().unwrap();
65-
let num_samples = block.len() as i64 * block.channels() as i64;
66-
sample_times_ns.push(duration_ns as f64 / num_samples as f64);
65+
sample_times_ns.push(duration_ns as f64 / block.len() as f64);
6766
frame_epoch = now;
6867

6968
// Recycle the buffer for the next frame. There should be a

0 commit comments

Comments
 (0)