mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[work loop] Prevent work loop from being inlined (#16865)
Uses Closure Compiler's `@noinline` directive. See https://github.com/google/closure-compiler/wiki/Annotating-JavaScript-for-the-Closure-Compiler#noinline
This commit is contained in:
@@ -1422,6 +1422,8 @@ 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) {
|
||||
@@ -1429,6 +1431,7 @@ function workLoopSync() {
|
||||
}
|
||||
}
|
||||
|
||||
/** @noinline */
|
||||
function workLoop() {
|
||||
// Perform work until Scheduler asks us to yield
|
||||
while (workInProgress !== null && !shouldYield()) {
|
||||
|
||||
Reference in New Issue
Block a user