Skip to content

Commit b55ff3c

Browse files
authored
Merge pull request #4278 from facebook/bench_x100
bench: better result alignment
2 parents 283fbd2 + 60f84f7 commit b55ff3c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

programs/benchzstd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ static BMK_benchOutcome_t BMK_benchMemAdvancedNoAlloc(
633633
}
634634

635635
{
636-
int const ratioAccuracy = (ratio < 10.) ? 3 : 2;
636+
int const ratioDigits = 1 + (ratio < 100.) + (ratio < 10.);
637637
assert(cSize < UINT_MAX);
638638
OUTPUTLEVEL(
639639
2,
@@ -642,7 +642,7 @@ static BMK_benchOutcome_t BMK_benchMemAdvancedNoAlloc(
642642
displayName,
643643
(unsigned)srcSize,
644644
(unsigned)cSize,
645-
ratioAccuracy,
645+
ratioDigits,
646646
ratio,
647647
benchResult.cSpeed < (10 * MB_UNIT) ? 2 : 1,
648648
(double)benchResult.cSpeed / MB_UNIT);
@@ -669,15 +669,15 @@ static BMK_benchOutcome_t BMK_benchMemAdvancedNoAlloc(
669669
}
670670

671671
{
672-
int const ratioAccuracy = (ratio < 10.) ? 3 : 2;
672+
int const ratioDigits = 1 + (ratio < 100.) + (ratio < 10.);
673673
OUTPUTLEVEL(
674674
2,
675675
"%2s-%-17.17s :%10u ->%10u (x%5.*f), %6.*f MB/s, %6.1f MB/s\r",
676676
marks[markNb],
677677
displayName,
678678
(unsigned)srcSize,
679679
(unsigned)cSize,
680-
ratioAccuracy,
680+
ratioDigits,
681681
ratio,
682682
benchResult.cSpeed < (10 * MB_UNIT) ? 2 : 1,
683683
(double)benchResult.cSpeed / MB_UNIT,

0 commit comments

Comments
 (0)