@noinline
(nonIdle: boolean)
| 2963 | |
| 2964 | /** @noinline */ |
| 2965 | function workLoopConcurrent(nonIdle: boolean) { |
| 2966 | // We yield every other "frame" when rendering Transition or Retries. Those are blocking |
| 2967 | // revealing new content. The purpose of this yield is not to avoid the overhead of yielding, |
| 2968 | // which is very low, but rather to intentionally block any frequently occuring other main |
| 2969 | // thread work like animations from starving our work. In other words, the purpose of this |
| 2970 | // is to reduce the framerate of animations to 30 frames per second. |
| 2971 | // For Idle work we yield every 5ms to keep animations going smooth. |
| 2972 | if (workInProgress !== null) { |
| 2973 | const yieldAfter = now() + (nonIdle ? 25 : 5); |
| 2974 | do { |
| 2975 | // $FlowFixMe[incompatible-call] flow doesn't know that now() is side-effect free |
| 2976 | performUnitOfWork(workInProgress); |
| 2977 | } while (workInProgress !== null && now() < yieldAfter); |
| 2978 | } |
| 2979 | } |
| 2980 | |
| 2981 | /** @noinline */ |
| 2982 | function workLoopConcurrentByScheduler() { |
no test coverage detected