Bug 237005 - [JSC] Format the output of --reportTotalPhaseTimes=1 more nicely
Summary: [JSC] Format the output of --reportTotalPhaseTimes=1 more nicely
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Robin Morisset
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-21 16:29 PST by Robin Morisset
Modified: 2022-02-21 22:56 PST (History)
14 users (show)

See Also:


Attachments
Patch (27.10 KB, patch)
2022-02-21 16:36 PST, Robin Morisset
no flags Details | Formatted Diff | Diff
Patch (27.09 KB, patch)
2022-02-21 16:41 PST, Robin Morisset
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Morisset 2022-02-21 16:29:54 PST
Currently, here is an example of the output of --reportTotalPhaseTimes=1:
```
[B3] moveConstants total ms: 64.307583 max ms: 1.703167
[B3] lowerToAir total ms: 151.297782 max ms: 5.426375
[B3] generateToAir total ms: 1623.987166 max ms: 92.826750
[B3] simplifyCFG total ms: 11.760463 max ms: 1.088083
[B3] Air::lowerMacros total ms: 5.975679 max ms: 0.382000
```

There are two frustrating things here:
- The numbers are not aligned, so it is not visible at a glance which passes take 1 order of magnitude more than others
- everything is just tagged by [B3] even when they're actually Air, and passes are tagged in the same way as combination of passes (like generateToAir).

I propose a simple formatting change that would output it as follows:
```
total ms:   66.328 max ms:   2.283 [B3] moveConstants
total ms:  148.097 max ms:   5.361 [B3] lowerToAir
total ms: 1619.115 max ms:  96.307 [Total B3] generateToAir
total ms:   11.959 max ms:   1.185 [Air] simplifyCFG
total ms:    6.519 max ms:   0.697 [Air] Air::lowerMacros
```

I found this a lot more readable when trying to optimize parts of the FTL compiler.
Comment 1 Robin Morisset 2022-02-21 16:36:56 PST
Created attachment 452796 [details]
Patch
Comment 2 Robin Morisset 2022-02-21 16:41:05 PST
Created attachment 452798 [details]
Patch

Fix style nits.
Comment 3 Saam Barati 2022-02-21 18:26:20 PST
Comment on attachment 452798 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=452798&action=review

r=me. Nice

> Source/WTF/wtf/FixedWidthDouble.h:2
> + * Copyright (C) 2021 Apple Inc. All rights reserved.

2022
Comment 4 EWS 2022-02-21 22:55:16 PST
Committed r290290 (247614@main): <https://commits.webkit.org/247614@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 452798 [details].
Comment 5 Radar WebKit Bug Importer 2022-02-21 22:56:19 PST
<rdar://problem/89277242>