-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #1663 by increasing the kMaxIterations limit. #1664
Conversation
An alternative could be to get rid of this limit; from the code, it is not clear why it is needed.
src/console_reporter.cc
Outdated
@@ -56,7 +56,7 @@ bool ConsoleReporter::ReportContext(const Context& context) { | |||
BENCHMARK_EXPORT | |||
void ConsoleReporter::PrintHeader(const Run& run) { | |||
std::string str = | |||
FormatString("%-*s %13s %15s %12s", static_cast<int>(name_field_width_), | |||
FormatString("%-*s %13s %15s %15s", static_cast<int>(name_field_width_), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main concern would be that the lines become even longer now.
I suppose i'd be fine with the limit bump, but degradation of the output makes me do a second take.
increasing the limit vs getting rid of the limit both suffer from the same issue, which is that for slow benchmarks without a minimum time, they just became a lot slower. |
actually i take that back... at |
Yeah, i've looked at it's usage, and i'm not really sure if it is not needed or needed. benchmark/src/benchmark_runner.cc Lines 330 to 331 in 46d3c84
which seems to benefit from it. |
yeah, this coupled with the end-of-benchmark check below is what puts the cap on. we could remove both, at which point we'd keep increasing iterations until we hit i'm also happy with the current patch. |
(To repeat myself - limit bump LGTM, printing change NACK) |
What's the concern about the line length? The line length is variable already (as it's based on the length of the benchmark name). Why are three additional characters problematic? |
There's always some line width in the terminal/editor/viewer where (I vaguely recall having similar discussion in this repo years ago, but i don't have a link) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really not a fan of reprinting headers...
What do you suggest instead? According to the statistics in your previous message, reprinting would not happen for 99.9+% of the existing benchmarks. |
@LebedevRI I'm having a hard time think of any alternatives. either the line length gets longer and things misalign (if no printing changes are made), or the line length is always longer (I'm not a fan of this trend either), or the current version where it grows when necessary and the headers get reprinted at that point. I don't have a strong opinion but I am stuck thinking of anything else to suggest. |
The only other unmentioned option is fully buffering the output, but that is even worse.
Note: this is what currently happens when the time fields "overflow".
Yup.
I agree that the solution is elegant. I'm basically unsure if this misalignment is worth the confusion What i would certainly suggest is to proceed with the uncontentious change, |
by which you mean: change the limit, make no changes to printing and allow any benchmark that goes above the old kMaxIterations to print awkwardly? i'm ok with that. |
Yes. |
Would you prefer that I create a new pull request that contains just the uncontentious change, or that I undo the other changes in this pull request? |
No preference. |
Yet another option would be to print it (potentially imprecisely) as a floating point number (something like |
this is superseded by #1668 right? |
Yes, that's correct. |
An alternative could be to get rid of this limit; from the code, it is not clear why it is needed.