Commit 30778d1
[RPP] Apply optimizations to statsForTimeRange
This trace is of the performance panel: https://trace.cafe/t/zP4zA7sNLb.
One thing of interest is that `statsForTimeRange` takes 3.5s, which is
33% of the `loadingComplete` callback.
One thing that jumped out to me is that 33% of `statsForTimeRange` is
spent inside `eventTimingsMilliSeconds`. The work this method must do
is simple, but it calls another method in an effort to DRY the code.
This creates an extra object allocation. Additionally, it uses the
timing tag and conversion functions multiple times. Given these are
called 100,000s of times during the processing of this trace, that adds
up. Un-DRYing the code and should have a good effect.
Additionally, `statsForTimeRange` can get away with calling
`eventTimingsMicroseconds` instead of `eventTimingsMilliSeconds`, which
saves 3 divisions per trace event.
Bug: None
Change-Id: Ie7ace912ebaac6c879233a809223710264081ed0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6154635
Reviewed-by: Paul Irish <[email protected]>
Commit-Queue: Connor Clark <[email protected]>1 parent 2a31e37 commit 30778d1
File tree
3 files changed
+13
-31
lines changed- front_end
- models/trace/helpers
- panels/timeline
3 files changed
+13
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | 67 | | |
80 | 68 | | |
81 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
84 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
89 | 88 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
101 | 92 | | |
102 | 93 | | |
103 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2066 | 2066 | | |
2067 | 2067 | | |
2068 | 2068 | | |
2069 | | - | |
| 2069 | + | |
2070 | 2070 | | |
2071 | | - | |
| 2071 | + | |
2072 | 2072 | | |
2073 | 2073 | | |
2074 | 2074 | | |
| |||
2081 | 2081 | | |
2082 | 2082 | | |
2083 | 2083 | | |
2084 | | - | |
| 2084 | + | |
2085 | 2085 | | |
2086 | 2086 | | |
2087 | 2087 | | |
| |||
2105 | 2105 | | |
2106 | 2106 | | |
2107 | 2107 | | |
2108 | | - | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
2109 | 2112 | | |
2110 | 2113 | | |
2111 | 2114 | | |
| |||
0 commit comments