Skip to content

Commit d6469e2

Browse files
committed
feat(bench): show human-readable output even when outputting JSON
Changed behavior to always display human-readable benchmark results, regardless of output format. JSON output is now additive: - Console output: always shown - JSON output: also generated if --format json is specified Benefits: - Users can see progress and results in real-time - JSON can be saved to file with --output for later analysis - No need to choose between readability and structured data Before: --format json hid all human-readable output After: --format json shows readable output AND generates JSON
1 parent 5bb80b5 commit d6469e2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bin/bench_throughput.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -829,9 +829,7 @@ fn main() {
829829
match benchmark_template(template_name, template_str, &sizes, iterations, detailed) {
830830
Ok(results) => {
831831
println!("✓");
832-
if format == "console" {
833-
print_template_results(template_name, &results, detailed);
834-
}
832+
print_template_results(template_name, &results, detailed);
835833
all_results.push((*template_name, results));
836834
}
837835
Err(e) => {
@@ -841,9 +839,9 @@ fn main() {
841839
}
842840
}
843841

844-
if format == "console" {
845-
print_summary(&all_results);
846-
} else if format == "json" {
842+
print_summary(&all_results);
843+
844+
if format == "json" {
847845
if let Err(e) = output_json(&all_results, output_path.map(|s| s.as_str())) {
848846
eprintln!("Error writing JSON output: {}", e);
849847
std::process::exit(1);

0 commit comments

Comments
 (0)