BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Left Justification option for summary table columns

Open erichiller opened this issue 3 years ago • 1 comments
trafficstars

It would be useful if there was an option to align/justify the Method column (leftmost column when there's only one namespace and It would be useful if there was an option to align/justify the Method column (leftmost column when there's only one namespace and class). My use case is that I typically name my methods in order of increasing specificity (opposite of DNS).

eg. this:

Method                            | Metric 1
----------------------------------|-------------
MajorMinorSpecificBaseline        | 1
MajorMinorSpecificDoItOneWay      | 2
SomeVeryDifferentMinorSpecific    | 3
MajorMinorSpecificDoItAnotherWay  | 4

Rather than the current:

Method                            | Metric 1
----------------------------------|-------------
       MajorMinorSpecificBaseline | 1
     MajorMinorSpecificDoItOneWay | 2
   SomeVeryDifferentMinorSpecific | 3
 MajorMinorSpecificDoItAnotherWay | 4

With left justification, the bases are aligned which makes it easier for me to quickly scan the column and see what methods are similar. Whereas with right justification there is no alignment between names at all.

My thought was adding something like DefaultTextColumnJustification to SummaryStyle with a type of TextJustification.

From a brief glance, I think the following would need to change:

erichiller avatar Apr 17 '22 15:04 erichiller

@erichiller it sounds reasonable, please send a PR

adamsitnik avatar Apr 20 '22 06:04 adamsitnik