GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — benchmark: respect stream/iter broadcast backpressure · nodejs/node@9a394ba

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • benchmark/streams
    • iter-throughput-broadcast.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎benchmark/streams/iter-throughput-broadcast.js‎

Copy file name to clipboardExpand all lines: benchmark/streams/iter-throughput-broadcast.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,11 @@ function benchIter(chunk, numConsumers, datasize, n, totalOps) {
128128
let remaining = datasize;
129129
while (remaining > 0) {
130130
const size = Math.min(remaining, chunk.length);
131-
remaining -= size;
132131
const buf = size === chunk.length ? chunk : chunk.subarray(0, size);
133-
writer.writeSync(buf);
132+
if (!writer.writeSync(buf)) {
133+
await writer.write(buf);
134+
}
135+
remaining -= size;
134136
}
135137
writer.endSync();
136138

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.