Skip to content

Commit

Permalink
[work loop] Prevent work loop from being inlined (#16865)
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Sep 23, 2019
1 parent 312b462 commit a87d245
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1422,13 +1422,16 @@ function inferTimeFromExpirationTimeWithSuspenseConfig(
);
}

// The work loop is an extremely hot path. Tell Closure not to inline it.
/** @noinline */
function workLoopSync() {
// Already timed out, so perform work without checking if we need to yield.
while (workInProgress !== null) {
workInProgress = performUnitOfWork(workInProgress);
}
}

/** @noinline */
function workLoop() {
// Perform work until Scheduler asks us to yield
while (workInProgress !== null && !shouldYield()) {
Expand Down

0 comments on commit a87d245

Please sign in to comment.