Repository navigation
Commit dc17197
committed
perf(core): stream a generator's output to the generators that read it
Every dependency edge was a full barrier: the cache collected all of a
generator's chunks before its dependents started, so each stage of a
build waited for the whole of the one before it.
A generator can now set streamsInput: true to receive its dependency's
output as an async iterable of chunks, read as they are produced. With
one thread nothing runs alongside, so it still gets one array, and a
dependency that doesn't stream arrives as a single chunk. Nothing sets
it yet.
The cache runs a streamed generator once, recording its chunks so any
number of readers each read all of them, from the first, while it still
runs. Once every reader has started, it lets go of a chunk as soon as
all of them have read it, rather than holding the output until the last
one is done.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Sonnet 5.5 <noreply@anthropic.com>1 parent e677946 commit dc17197
9 files changed
Lines changed: 985 additions & 41 deletions
File tree
- .changeset
- docs
- packages/core/src
- __tests__
- generators
- utils
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
| 334 | + | |
334 | 335 | | |
335 | 336 | | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
336 | 388 | | |
337 | 389 | | |
338 | 390 | | |
| |||
0 commit comments