Improved profiler result printing.#7709
Conversation
| } | ||
|
|
||
| float ft = fs->time / (p->runs * 1000000.0f); | ||
| if (ft < 10000) sstr << " "; |
There was a problem hiding this comment.
All "if" statements in Halide should be in {braces}, even trivial single-line ones like these
There was a problem hiding this comment.
Oh, hmm. Then why doesn't the clang-format CI-step complain?
There was a problem hiding this comment.
clang-format didn't, but clang-tidy did
There was a problem hiding this comment.
Ah, what, clang-tidy checks this separately. Clang-format has an option for this too, I believe.
|
Dang this clang-tidy fix makes the code really ugly... |
|
Yeah, clang-tidy and clang-format make things better on average. There are definitely cases where it makes things worse, but it's worth it in expectation. |
|
I can surround it with |
We should fix our clang-format setings to enforce this as well (if possible). In the meantime, please just manually format in a way that makes clang-tidy happy; we prefer to reserve |
|
Okay, then this is it. 😄 |
steven-johnson
left a comment
There was a problem hiding this comment.
Thanks for the fix!
* Fixed the regularization for BGU. * Improved profiler result printing. * Clang-format ain't liking pretty code. * Clang-tidy ain't liking pretty code. --------- Co-authored-by: Steven Johnson <srj@google.com>
This 50-cents improvement makes my profiling reports more readable, as I have long function names. Additionally, I cheaply aligned the timing by printing spacing depending on how many order of magnitude the number spans. Example output below: