google / benchmark

A microbenchmark support library
Apache License 2.0
8.94k stars 1.62k forks source link

fix: added benchmark_counters_tabular for file #1645

Closed varshneydevansh closed 1 year ago

varshneydevansh commented 1 year ago

The basics

The details

Resolves

Proposed Changes

--benchmark_counters_tabular=true flag should be correctly applied for the output files for the --benchmark_out_format=console

Behavior Before Change

------------------------------------------------------------------------------------
Benchmark                          Time             CPU   Iterations UserCounters...
------------------------------------------------------------------------------------
l4cp_a_c/32/manual_time      3349447 ns        74761 ns          209 flush=0.68267 items_per_second=298.557/s
l4cp_a_c/512/manual_time    20886315 ns        0.000 ns           34 flush=0.707233 items_per_second=47.8782/s
l4cp_a_f/32/manual_time        62964 ns        45752 ns        10587 flush=0.0637161 items_per_second=15.8821k/s
l4cp_a_f/512/manual_time      182277 ns        50457 ns         3716 flush=0.216913 items_per_second=5.48616k/s

Behavior After Change

------------------------------------------------------------------------------------
Benchmark                          Time             CPU   Iterations     flush  items_per_second
------------------------------------------------------------------------------------
l4cp_a_c/32/manual_time      3349447 ns        74761 ns          209   0.68267         298.557/s
l4cp_a_c/512/manual_time    20886315 ns        0.000 ns           34  0.707233         47.8782/s
l4cp_a_f/32/manual_time        62964 ns        45752 ns        10587 0.0637161        15.8821k/s
l4cp_a_f/512/manual_time      182277 ns        50457 ns         3716  0.216913        5.48616k/s

Reason for Changes

With the latest version, the below command line should be applied to the output file for the console option for a clear output.

$ ./bm --benchmark_out=result.txt --benchmark_out_format=console
--benchmark_counters_tabular=true

Test Coverage

I haven't tested this, as soon as I got confirmation that these are the required changes that will update the status of the Test Coverage.

Documentation

I do not think there is any need for the documentation changes/ update as it's a bug which is correcting the output for the files.

Additional Information

dmah42 commented 1 year ago

amazing. thank you!