Commit fadb214
authored
stream: readable read one buffer at a time
Instead of wasting cycles concatenating buffers, just return each
one by one.
Similar (but not exact) old behavior can be achieved by using
`readable.read(readable.readableLength)` instead of
`readable.read()`. In some edge cases it might be necessary
to do a `readable.read(0)` first.
PR: #60441
PR-URL: #60441
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>1 parent a5ae2b2 commit fadb214Copy full SHA for fadb214
17 files changed
+82-47Lines changed: 82 additions & 47 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- lib/internal/streams
- test
- common
- parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
lib/internal/streams/readable.js
Copy file name to clipboardExpand all lines: lib/internal/streams/readable.js+5Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
636 | 636 | |
637 | 637 | |
638 | 638 | |
| 639 | + |
| 640 | + |
| 641 | + |
| 642 | + |
639 | 643 | |
640 | 644 | |
641 | 645 | |
| 646 | + |
642 | 647 | |
643 | 648 | |
644 | 649 | |
|
Collapse file
+2-1Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | | - |
| 24 | + |
| 25 | + |
25 | 26 | |
26 | 27 | |
27 | 28 | |
|
Collapse file
test/parallel/test-crypto-cipheriv-decipheriv.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-cipheriv-decipheriv.js+2-2Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
31 | 31 | |
32 | 32 | |
33 | 33 | |
34 | | - |
| 34 | + |
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | | - |
| 38 | + |
39 | 39 | |
40 | 40 | |
41 | 41 | |
|
Collapse file
test/parallel/test-runner-run.mjs
Copy file name to clipboardExpand all lines: test/parallel/test-runner-run.mjs+16-18Lines changed: 16 additions & 18 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
7 | 8 | |
8 | 9 | |
| ||
111 | 112 | |
112 | 113 | |
113 | 114 | |
114 | | - |
| 115 | + |
115 | 116 | |
116 | | - |
117 | | - |
118 | | - |
119 | | - |
120 | | - |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
121 | 121 | |
122 | 122 | |
123 | 123 | |
124 | 124 | |
125 | | - |
| 125 | + |
126 | 126 | |
127 | | - |
128 | | - |
129 | | - |
130 | | - |
131 | | - |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
132 | 131 | |
133 | 132 | |
134 | 133 | |
135 | | - |
| 134 | + |
136 | 135 | |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
142 | 140 | |
143 | 141 | |
144 | 142 | |
|
Collapse file
test/parallel/test-stream-compose.js
Copy file name to clipboardExpand all lines: test/parallel/test-stream-compose.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
490 | 490 | |
491 | 491 | |
492 | 492 | |
493 | | - |
| 493 | + |
494 | 494 | |
495 | 495 | |
496 | 496 | |
|
Collapse file
test/parallel/test-stream-push-strings.js
Copy file name to clipboardExpand all lines: test/parallel/test-stream-push-strings.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
59 | 59 | |
60 | 60 | |
61 | 61 | |
62 | | - |
| 62 | + |
63 | 63 | |
64 | 64 | |
65 | 65 | |
|
Collapse file
test/parallel/test-stream-readable-emittedReadable.js
Copy file name to clipboardExpand all lines: test/parallel/test-stream-readable-emittedReadable.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10 | 10 | |
11 | 11 | |
12 | 12 | |
13 | | - |
| 13 | + |
14 | 14 | |
15 | 15 | |
16 | 16 | |
|
Collapse file
test/parallel/test-stream-readable-infinite-read.js
Copy file name to clipboardExpand all lines: test/parallel/test-stream-readable-infinite-read.js+3-11Lines changed: 3 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
10 | 10 | |
11 | 11 | |
12 | 12 | |
13 | | - |
| 13 | + |
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | 18 | |
19 | 19 | |
20 | | - |
21 | | - |
| 20 | + |
22 | 21 | |
23 | 22 | |
24 | 23 | |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | | - |
30 | | - |
31 | | - |
32 | | - |
| 24 | + |
33 | 25 | |
Collapse file
test/parallel/test-stream-readable-needReadable.js
Copy file name to clipboardExpand all lines: test/parallel/test-stream-readable-needReadable.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
32 | 32 | |
33 | 33 | |
34 | 34 | |
35 | | - |
| 35 | + |
36 | 36 | |
37 | 37 | |
38 | 38 | |
|
Collapse file
test/parallel/test-stream-readable-readable-one.js
Copy file name to clipboard+20Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
0 commit comments