Re: [whatwg/streams] Add WritableStreamDefaultController.releaseBackpressure() (PR #1190)

> I'm concerned that people may be relying on the existing behaviour. With buffering, all the transforms in a pipe can run in parallel, 

@ricea I assume you mean "all the transforms in a pipe can run in parallel _with each other_" here. I.e. they all have data available to work on at the same time.

> but without it they will run in series.

And here your concern is all but one will sit idle waiting for data upstream, as observed from any one point in time?

I don't think that'd be the case. Assuming sufficient input data and transforms taking approximately the same time, all async transforms should still run in parallel with each other, even with HWM = 0. The only difference being that, from the perspective of each transform, the transform upstream of it is working on a newer chunk, at the same time.

* Snapshot at time X: camera → transformA(frame4) → transformB(frame3) → transformC(frame2) → sink(frame1)

These seem like reasonable assumptions for a healthy real-time stream.

But what seems true (and maybe this is what you worry about) is that this ideal never happens, and even tiny transform delays will accumulate (delayABC), which could blow a realtime buffer. Sure.

For example e.g. transformB spikes, taking 50% longer than usual on frame3, but then immediately makes up for it by taking half the normal time on frame4. Here HWM = 1 might improve resilience to variance. But to smooth out any longer delays than that will take a deeper buffer anyway, so I don't think the difference of 0 to 1 is foundational, unless I'm missing something.

> This could cause mysterious performance regressions.


-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1190#issuecomment-1079181454

You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/pull/1190/c1079181454@github.com>

Received on Friday, 25 March 2022 16:14:01 UTC