Skip to content

Commit 8152e5c

Browse files
authored
Remove execution context check from shouldProfile (#30971)
I don't know why this is here since all these callsites are within the CommitWork/CommitEffects helpers. This should help with inlining.
1 parent d7167c3 commit 8152e5c

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

packages/react-reconciler/src/ReactFiberCommitEffects.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ import {getPublicInstance} from './ReactFiberConfig';
4646
import {
4747
captureCommitPhaseError,
4848
setIsRunningInsertionEffect,
49-
getExecutionContext,
50-
CommitContext,
51-
NoContext,
5249
} from './ReactFiberWorkLoop';
5350
import {
5451
NoFlags as NoHookEffect,
@@ -81,8 +78,7 @@ function shouldProfile(current: Fiber): boolean {
8178
return (
8279
enableProfilerTimer &&
8380
enableProfilerCommitHooks &&
84-
(current.mode & ProfileMode) !== NoMode &&
85-
(getExecutionContext() & CommitContext) !== NoContext
81+
(current.mode & ProfileMode) !== NoMode
8682
);
8783
}
8884

@@ -919,7 +915,7 @@ export function commitProfilerUpdate(
919915
commitTime: number,
920916
effectDuration: number,
921917
) {
922-
if (enableProfilerTimer && getExecutionContext() & CommitContext) {
918+
if (enableProfilerTimer) {
923919
try {
924920
if (__DEV__) {
925921
runWithFiberInDEV(

packages/react-reconciler/src/ReactFiberCommitWork.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ import {
145145
addMarkerProgressCallbackToPendingTransition,
146146
addMarkerIncompleteCallbackToPendingTransition,
147147
addMarkerCompleteCallbackToPendingTransition,
148-
getExecutionContext,
149-
CommitContext,
150-
NoContext,
151148
setIsRunningInsertionEffect,
152149
} from './ReactFiberWorkLoop';
153150
import {
@@ -233,8 +230,7 @@ function shouldProfile(current: Fiber): boolean {
233230
return (
234231
enableProfilerTimer &&
235232
enableProfilerCommitHooks &&
236-
(current.mode & ProfileMode) !== NoMode &&
237-
(getExecutionContext() & CommitContext) !== NoContext
233+
(current.mode & ProfileMode) !== NoMode
238234
);
239235
}
240236

@@ -2817,11 +2813,7 @@ function commitPassiveMountOnFiber(
28172813

28182814
// Only Profilers with work in their subtree will have a Passive effect scheduled.
28192815
if (flags & Passive) {
2820-
if (
2821-
enableProfilerTimer &&
2822-
enableProfilerCommitHooks &&
2823-
getExecutionContext() & CommitContext
2824-
) {
2816+
if (enableProfilerTimer && enableProfilerCommitHooks) {
28252817
const {passiveEffectDuration} = finishedWork.stateNode;
28262818

28272819
commitProfilerPostCommit(

0 commit comments

Comments
 (0)