Re: [whatwg/streams] light weight transformations (#461)

One thing I want to reassure people on, after seeing things like https://github.com/gwicke/mixmaster, is that we are very concerned about making transform streams performant. A lot of the locking infrastructure is in place specifically so that when you do `rs.pipeThrough(transformStream)`, it can bypass a lot of the intermediate layers and just shuffle data from `rs` to `transformStream.readable`. The reference implementation is very early stage and does not reflect these kind of optimizations at all, so people shouldn't be taking it seriously as the ultimate destination.

Basically, imagine the syntax of the reference implementation, which is probably going to end up on something like

```js
new TransformStream({
  transform(chunk, controller) {
    // use controller.enqueue()
    // return promise to succeed/fail asynchronously
  },
  flush(controller) {
    // return promise to close/error asynchronously
  }
});
```

and then imagine the fastest possible implementation of getting data from point A to point B while applying the transform and flushing logic specified by those two functions. That is what we aim to make implementable in browsers (and polyfills).

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/461#issuecomment-236841160

Received on Tuesday, 2 August 2016 08:41:21 UTC