Commit 7ac8e61
authored
Only log component level profiling for components that actually performed work (#31522)
This provides less context but skips a lot of noise.
Previously we were including parent components to provide context about
what is rendering but this turns out to be:
1) Very expensive due to the overhead of `performance.measure()` while
profiling.
2) Unactionable noise in the profile that hurt more than it added in
real apps with large trees.
This approach instead just add performance.measure calls for each
component that was marked as PerformedWork (which was used for this
purpose by React Profiler) or had any Effects.
Not everything gets marked with PerformedWork though. E.g. DOM nodes do
not but they can have significant render times since creating them takes
time. We might consider including them if a self-time threshold is met.
Because there is little to no context about the component anymore it
becomes really essential to get a feature from Chrome DevTools that can
link to something with more context like React DevTools.1 parent 3770c11 commit 7ac8e61
1 file changed
+11
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
602 | 603 | | |
603 | 604 | | |
604 | 605 | | |
605 | | - | |
| 606 | + | |
| 607 | + | |
606 | 608 | | |
607 | 609 | | |
608 | 610 | | |
| |||
2106 | 2108 | | |
2107 | 2109 | | |
2108 | 2110 | | |
2109 | | - | |
| 2111 | + | |
| 2112 | + | |
2110 | 2113 | | |
2111 | 2114 | | |
2112 | 2115 | | |
| |||
2647 | 2650 | | |
2648 | 2651 | | |
2649 | 2652 | | |
2650 | | - | |
| 2653 | + | |
| 2654 | + | |
2651 | 2655 | | |
2652 | 2656 | | |
2653 | 2657 | | |
| |||
2929 | 2933 | | |
2930 | 2934 | | |
2931 | 2935 | | |
2932 | | - | |
| 2936 | + | |
| 2937 | + | |
2933 | 2938 | | |
2934 | 2939 | | |
2935 | 2940 | | |
| |||
3448 | 3453 | | |
3449 | 3454 | | |
3450 | 3455 | | |
3451 | | - | |
| 3456 | + | |
| 3457 | + | |
3452 | 3458 | | |
3453 | 3459 | | |
3454 | 3460 | | |
| |||
0 commit comments