Skip to content

Commit 53a6a20

Browse files
committed
Separate numbers in runtime benchmark results with commas
1 parent e56aacb commit 53a6a20

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Cargo.lock

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ walkdir = "2"
3434
flate2 = { version = "1.0.22", features = ["rust_backend"] }
3535
rayon = "1.5.2"
3636
cargo_metadata = "0.15.0"
37+
thousands = "0.2.0"
38+
3739
benchlib = { path = "benchlib" }
3840

3941
[target.'cfg(windows)'.dependencies]

collector/src/runtime/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use benchlib::comm::messages::{BenchmarkMessage, BenchmarkResult, BenchmarkStats
55
use std::io::{BufRead, BufReader};
66
use std::path::{Path, PathBuf};
77
use std::process::{Command, Stdio};
8+
use thousands::Separable;
89

910
pub use benchmark::BenchmarkFilter;
1011

@@ -118,7 +119,11 @@ fn print_stats(result: &BenchmarkResult) {
118119
)
119120
.sqrt();
120121

121-
println!("{name:>20}: {:>16} (+/- {:>8})", mean as u64, stddev as u64);
122+
println!(
123+
"{name:>20}: {:>16} (+/- {:>8})",
124+
(mean as u64).separate_with_commas(),
125+
(stddev as u64).separate_with_commas()
126+
);
122127
} else {
123128
println!("{name:>20}: Not available");
124129
}

0 commit comments

Comments
 (0)