mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
f8e3da903bd45449b115163ac36c4cbe2cc3e28b
Stacked on #30979. The problem with the previous approach is that it recursively walked the tree up to propagate the resulting time from recording a layout effect. Instead, we keep a running count of the effect duration on the module scope. Then we reset it when entering a nested Profiler and then we add its elapsed count when we exit the Profiler. This also fixes a bug where we weren't previously including unmount times for some detached trees since they couldn't bubble up to find the profiler. DiffTrain build for commit https://github.com/facebook/react/commit/4549be0f846e7df5a4eaabf06369d93bd120271e.
[Fiber] Optimize enableProfilerCommitHooks by Collecting Elapsed Effect Duration in Module Scope (#30981)
react-fbsource-import
Description
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%