Commit fc5ef50
authored
[Flight] Start initial work immediately (#30961)
In a past update we made render and prerender have different work
scheduling behavior because these methods are meant to be used in
differeent environments with different performance tradeoffs in mind.
For instance to prioritize streaming we want to allow as much IO to
complete before triggering a round of work because we want to flush as
few intermediate UI states. With Prerendering there will never be any
intermediate UI states so we can more aggressively render tasks as they
complete.
One thing we've found is that even during render we should ideally kick
off work immediately. This update normalizes the intitial work for
render and prerender to start in a microtask. Choosing microtask over
sync is somewhat arbitrary but there really isn't a reason to make them
different between render/prerender so for now we'll unify them and keep
it as a microtask for now.
This change also updates pinging behavior. If the request is still in
the initial task that spawned it then pings will schedule on the
microtask queue. This allows immediately available async APIs to resolve
right away. The concern with doing this for normal pings is that it
might crowd out IO events but since this is the initial task there would
be IO to already be scheduled.1 parent b75cc07 commit fc5ef50
1 file changed
+24
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
355 | 364 | | |
356 | | - | |
| 365 | + | |
357 | 366 | | |
358 | 367 | | |
359 | 368 | | |
| |||
426 | 435 | | |
427 | 436 | | |
428 | 437 | | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
| |||
472 | 473 | | |
473 | 474 | | |
474 | 475 | | |
475 | | - | |
| 476 | + | |
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
| |||
1794 | 1795 | | |
1795 | 1796 | | |
1796 | 1797 | | |
1797 | | - | |
| 1798 | + | |
1798 | 1799 | | |
1799 | 1800 | | |
1800 | 1801 | | |
| |||
4062 | 4063 | | |
4063 | 4064 | | |
4064 | 4065 | | |
4065 | | - | |
4066 | | - | |
4067 | | - | |
4068 | | - | |
4069 | | - | |
4070 | | - | |
4071 | | - | |
4072 | | - | |
| 4066 | + | |
| 4067 | + | |
| 4068 | + | |
| 4069 | + | |
4073 | 4070 | | |
4074 | | - | |
4075 | | - | |
4076 | | - | |
4077 | | - | |
4078 | | - | |
| 4071 | + | |
4079 | 4072 | | |
| 4073 | + | |
| 4074 | + | |
| 4075 | + | |
| 4076 | + | |
| 4077 | + | |
4080 | 4078 | | |
4081 | 4079 | | |
4082 | 4080 | | |
| |||
4129 | 4127 | | |
4130 | 4128 | | |
4131 | 4129 | | |
4132 | | - | |
| 4130 | + | |
| 4131 | + | |
4133 | 4132 | | |
4134 | 4133 | | |
4135 | 4134 | | |
| |||
0 commit comments