Commit e968e26
stream: improve performance for sync write finishes
Improve performance and reduce memory usage when a writable stream
is written to with the same callback (which is the most common case)
and when the write operation finishes synchronously (which is also
often the case).
confidence improvement accuracy (*) (**) (***)
streams/writable-manywrites.js sync='no' n=2000000 0.99 % ±3.20% ±4.28% ±5.61%
streams/writable-manywrites.js sync='yes' n=2000000 *** 710.69 % ±19.65% ±26.47% ±35.09%
Refs: #18013
Refs: #18367
PR-URL: #30710
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent 0ba877a commit e968e26Copy full SHA for e968e26
File tree
Expand file treeCollapse file tree
3 files changed
+66
-8
lines changedOpen diff view settings
Filter options
- benchmark/streams
- lib
- test/parallel
Expand file treeCollapse file tree
3 files changed
+66
-8
lines changedOpen diff view settings
Collapse file
benchmark/streams/writable-manywrites.js
Copy file name to clipboardExpand all lines: benchmark/streams/writable-manywrites.js+8-3Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
7 | | - |
| 7 | + |
| 8 | + |
8 | 9 | |
9 | 10 | |
10 | | - |
| 11 | + |
11 | 12 | |
12 | 13 | |
| 14 | + |
13 | 15 | |
14 | | - |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
15 | 20 | |
16 | 21 | |
17 | 22 | |
|
Collapse file
+28-5Lines changed: 28 additions & 5 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
142 | 142 | |
143 | 143 | |
144 | 144 | |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
145 | 149 | |
146 | 150 | |
147 | 151 | |
| ||
498 | 502 | |
499 | 503 | |
500 | 504 | |
501 | | - |
| 505 | + |
| 506 | + |
| 507 | + |
| 508 | + |
| 509 | + |
| 510 | + |
| 511 | + |
| 512 | + |
| 513 | + |
| 514 | + |
| 515 | + |
502 | 516 | |
503 | | - |
| 517 | + |
504 | 518 | |
505 | 519 | |
506 | 520 | |
507 | 521 | |
508 | | - |
| 522 | + |
| 523 | + |
| 524 | + |
| 525 | + |
| 526 | + |
| 527 | + |
509 | 528 | |
510 | 529 | |
511 | 530 | |
512 | 531 | |
513 | 532 | |
514 | 533 | |
515 | | - |
516 | | - |
| 534 | + |
| 535 | + |
| 536 | + |
| 537 | + |
| 538 | + |
| 539 | + |
517 | 540 | |
518 | 541 | |
519 | 542 | |
|
Collapse file
test/parallel/test-stream-writable-samecb-singletick.js
Copy file name to clipboard+30Lines changed: 30 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 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
0 commit comments