@samitouri / QOS-React-2 / commits / a87d245fc2

[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

Andrew Clark committed Sep 23, 2019 at 11:12 UTC a87d245fc2d0b5eedd5463e6f21bf12443489b15
1 file changed +3
packages/react-reconciler/src/ReactFiberWorkLoop.js
+3
@@ -1422,6 +1422,8 @@ function inferTimeFromExpirationTimeWithSuspenseConfig(
1422 );
1423 }
1424
1425 +// The work loop is an extremely hot path. Tell Closure not to inline it.
1426 +/** @noinline */
1427 function workLoopSync() {
1428 // Already timed out, so perform work without checking if we need to yield.
1429 while (workInProgress !== null) {
@@ -1429,6 +1431,7 @@ function workLoopSync() {
1431 }
1432 }
1433
1434 +/** @noinline */
1435 function workLoop() {
1436 // Perform work until Scheduler asks us to yield
1437 while (workInProgress !== null && !shouldYield()) {