Uh oh!
There was an error while loading. Please reload this page.
stream: sync writes don't need drain - #29087
Conversation
ea33898 to
3412764Compare3412764 to
49102aeCompareTrott
commented
Aug 13, 2019
@nodejs/streams |
nodejs-github-bot
commented
Aug 13, 2019
nodejs-github-bot
commented
Aug 14, 2019
mcollina
left a comment
There was a problem hiding this comment.
Good work! I agree that this is going to make things faster (however we will need benchmarks), but this is likely going to break users in many ways.
We can see this in the tests, where a bunch of nextTick had to be added. Do you think it would be possible to make this backward compatible?
@mcollina: I'm unsure how bad of a breaking change this actually is. The test "wrongly" assume that That being said. The only "fully" backwards compatible way I can think of is to do this as a hack for |
mcollina
commented
Aug 15, 2019
Then I think we should not implement this. We might decide to bring https://www.npmjs.com/package/syncthrough into core, as it solves the same problem in a non-breaking way. |
ronag
commented
Aug 15, 2019
@mcollina: Fair enough... feel free to close |
Minor fix and performance improvement. Synchronous writes do not require drain.
This can be a significant improvement especially for transform streams that do not perform any async work.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesNOTE TO SELF: Sync transform streams should have a no buffer option (i.e. hwm === 0).