Commit c0e70354 authored by isaacs's avatar isaacs
Browse files

stream: Short-circuit buffer pushes when flowing

When a stream is flowing, and not in the middle of a sync read, and
the read buffer currently has a length of 0, we can just emit a 'data'
event rather than push it onto the array, emit 'readable', and then
automatically call read().

As it happens, this is quite a frequent occurrence!  Making this change
brings the HTTP benchmarks back into a good place after the removal of
the .ondata/.onend socket kludge methods.
parent 967b5dbb
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment