Skip to content

benchmark: respect stream/iter broadcast backpressure#63314

Open
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-throughput-broadcast
Open

benchmark: respect stream/iter broadcast backpressure#63314
trivikr wants to merge 1 commit into
nodejs:mainfrom
trivikr:stream-iter-throughput-broadcast

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented May 15, 2026

This updates the stream/iter broadcast throughput benchmark to respect
backpressure from writer.writeSync().

Previously, the benchmark decremented remaining before checking whether
writeSync() accepted the chunk. Under default strict backpressure, rejected
writes could still be counted toward the benchmarked byte total. The iter path
now falls back to await writer.write(buf) for the same chunk and only counts it
after the write is accepted.


Assisted-by: openai:gpt-5.5

@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/performance

@nodejs-github-bot nodejs-github-bot added benchmark Issues and PRs related to the benchmark subsystem. stream Issues and PRs related to the stream subsystem. labels May 15, 2026
Only decrement the remaining byte count after a stream/iter broadcast
write is accepted. If writeSync() is blocked by strict backpressure,
fall back to the async write() path for the same chunk.

Signed-off-by: Kamat, Trivikram <[email protected]>
Assisted-by: openai:gpt-5.5
@trivikr trivikr force-pushed the stream-iter-throughput-broadcast branch from 1da5fa8 to 88ee786 Compare May 15, 2026 01:06
@trivikr trivikr changed the title benchmark: respect broadcast backpressure benchmark: respect stream/iter broadcast backpressure May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Issues and PRs related to the benchmark subsystem. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants