stream: fast path single-destination pipe#63592
Conversation
Avoid EventEmitter dispatch for the readable pipe data handler when it is the only data listener. Fall back to normal data event emission when additional data listeners are present to preserve listener ordering. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
|
Review requested:
|
ronag
left a comment
There was a problem hiding this comment.
This looks to me like it will break stuff. What happens if a data listener is added after pipe? Can you add a test for that.
If a
Added a test in The added test starts with |
2d523a1 to
3184889
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #63592 +/- ##
==========================================
- Coverage 90.32% 90.28% -0.05%
==========================================
Files 730 728 -2
Lines 234653 233562 -1091
Branches 43942 43782 -160
==========================================
- Hits 211959 210866 -1093
- Misses 14415 14503 +88
+ Partials 8279 8193 -86
🚀 New features to boost your workflow:
|
Avoid EventEmitter dispatch for the internal
readable.pipe()data handlerwhen it is the only
datalistener on the source stream.If any additional
datalistener is present, the stream falls back to normaldataevent emission so listener ordering is preserved.Benchmark:
Assisted-by: openai:gpt-5.5