Skip to content

Commit e70db3d

Browse files
committed
[Fiber] Optimize enableProfilerCommitHooks by Collecting Elapsed Effect Duration in Module Scope (#30981)
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 [4549be0](4549be0)
1 parent 905f7f3 commit e70db3d

34 files changed

+5394
-6834
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7b56a542987890f618eeda4e4906fbf1f1df2213
1+
4549be0f846e7df5a4eaabf06369d93bd120271e
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7b56a542987890f618eeda4e4906fbf1f1df2213
1+
4549be0f846e7df5a4eaabf06369d93bd120271e

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2001,7 +2001,7 @@ __DEV__ &&
20012001
exports.useTransition = function () {
20022002
return resolveDispatcher().useTransition();
20032003
};
2004-
exports.version = "19.0.0-www-classic-7b56a542-20240917";
2004+
exports.version = "19.0.0-www-classic-4549be0f-20240917";
20052005
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
20062006
"function" ===
20072007
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1981,7 +1981,7 @@ __DEV__ &&
19811981
exports.useTransition = function () {
19821982
return resolveDispatcher().useTransition();
19831983
};
1984-
exports.version = "19.0.0-www-modern-7b56a542-20240917";
1984+
exports.version = "19.0.0-www-modern-4549be0f-20240917";
19851985
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19861986
"function" ===
19871987
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-classic-7b56a542-20240917";
668+
exports.version = "19.0.0-www-classic-4549be0f-20240917";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,4 +665,4 @@ exports.useSyncExternalStore = function (
665665
exports.useTransition = function () {
666666
return ReactSharedInternals.H.useTransition();
667667
};
668-
exports.version = "19.0.0-www-modern-7b56a542-20240917";
668+
exports.version = "19.0.0-www-modern-4549be0f-20240917";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-classic-7b56a542-20240917";
672+
exports.version = "19.0.0-www-classic-4549be0f-20240917";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-modern-7b56a542-20240917";
672+
exports.version = "19.0.0-www-modern-4549be0f-20240917";
673673
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
674674
"function" ===
675675
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)