| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5
|
Review requested:
|
Sorry, something went wrong.
|
I'm not sure why I didn't see improvements in the previous PR in #63262 (comment) In this PR, I validated that benchmarks are run correctly $ ./configure --ninja
$ make JOBS=8
$ ./node benchmark/compare.js \
--old ../node_old \
--new ./node \
--runs 10 \
--filter iter-throughput-broadcast \
--no-progress \
streams > /tmp/broadcast.csv
$ cat /tmp/broadcast.csv | Rscript benchmark/compare.R |
Sorry, something went wrong.
|
Re-run benchmarks with 30 runs confidence improvement accuracy (*) (**) (***)
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=1 api='classic' *** 10.67 % ±2.96% ±3.94% ±5.13%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=1 api='iter' *** 13.41 % ±2.64% ±3.51% ±4.57%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=1 api='webstream' *** 49.68 % ±3.89% ±5.18% ±6.76%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=2 api='classic' *** 8.68 % ±3.12% ±4.16% ±5.43%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=2 api='iter' *** 11.49 % ±3.00% ±3.99% ±5.20%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=2 api='webstream' *** 33.26 % ±3.24% ±4.33% ±5.69%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=4 api='classic' *** 9.85 % ±3.28% ±4.38% ±5.72%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=4 api='iter' *** 15.16 % ±3.49% ±4.65% ±6.05%
streams/iter-throughput-broadcast.js n=5 datasize=1048576 consumers=4 api='webstream' *** 35.17 % ±2.90% ±3.86% ±5.03%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=1 api='classic' ** 4.34 % ±3.19% ±4.25% ±5.55%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=1 api='iter' *** 14.81 % ±5.90% ±7.90% ±10.37%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=1 api='webstream' *** 28.71 % ±2.92% ±3.91% ±5.13%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=2 api='classic' *** 6.16 % ±2.46% ±3.28% ±4.27%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=2 api='iter' *** 15.17 % ±6.29% ±8.43% ±11.11%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=2 api='webstream' *** 14.40 % ±3.90% ±5.20% ±6.78%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=4 api='classic' * 9.01 % ±6.96% ±9.31% ±12.21%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=4 api='iter' 2.17 % ±2.98% ±3.96% ±5.16%
streams/iter-throughput-broadcast.js n=5 datasize=16777216 consumers=4 api='webstream' *** 10.91 % ±2.35% ±3.13% ±4.09%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 18 comparisons, you can thus
expect the following amount of false-positive results:
0.90 false positives, when considering a 5% risk acceptance (*, **, ***),
0.18 false positives, when considering a 1% risk acceptance (**, ***),
0.02 false positives, when considering a 0.1% risk acceptance (***) |
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 80.43478% with 9 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #63322 +/- ##
=======================================
Coverage 90.04% 90.04%
=======================================
Files 714 714
Lines 225338 225364 +26
Branches 42598 42603 +5
=======================================
+ Hits 202897 202940 +43
+ Misses 14236 14198 -38
- Partials 8205 8226 +21
... and 30 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
Sorry, something went wrong.
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63322 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63322 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: nodejs#63322 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Track how many broadcast consumers share the cached minimum cursor, matching the share implementation. This lets buffer trimming avoid calling getMinCursor() until the last minimum-cursor consumer advances or detaches. Add coverage for fan-out trimming behavior. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: openai:gpt-5.5 PR-URL: #63322 Backport-PR-URL: #64675 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
| Back | FazBrowse Home | New Git URL |
Description
This ports the cached minimum-cursor consumer count used by share to
broadcast.
broadcast previously used a dirty min-cursor flag, causing trimming to call
getMinCursor() and scan all consumers whenever the cached minimum might have
changed. Under high fan-out, that can make normal consumer advancement pay an
O(consumers) cost.
This change tracks how many consumers are currently at the cached minimum
cursor. broadcast now only recomputes the minimum when the last such consumer
advances or detaches. The drop-oldest path still recomputes after forcing
lagging cursors forward.
Benchmark
Assisted-by: openai:gpt-5.5