stream Cargo JSON directly into BinaryList#3131
Merged
sunshowers merged 2 commits intoMar 9, 2026
Merged
Conversation
Previously, cargo-nextest buffered Cargo JSON output into a BufList and reparsed it after the build finished. Now it feeds each line directly into a shared BinaryListBuilder, preserving JSON forwarding behavior while avoiding the extra allocation and second parse. Also add a regression test for line-by-line parsing of Cargo output.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3131 +/- ##
==========================================
+ Coverage 84.43% 84.44% +0.01%
==========================================
Files 156 156
Lines 42733 42811 +78
==========================================
+ Hits 36080 36153 +73
- Misses 6653 6658 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sunshowers
approved these changes
Mar 9, 2026
sunshowers
left a comment
Member
There was a problem hiding this comment.
Thank you! Just a few minor notes for myself that I'll fix in a followup.
sunshowers
added a commit
that referenced
this pull request
Mar 9, 2026
Just a couple of minor cleanups.
sunshowers
added a commit
that referenced
this pull request
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
summary
BinaryListBuilderthat can consume Cargo messages incrementally, and reuse it fromBinaryList::from_messagescargo-nextestbinary-list build path to process Cargo stdout in one pass instead of buffering it and reparsing it laterCloses #3129.
testing
cargo xfmtcargo nextest run -p nextest-runner -p cargo-nextestexperimental findings
I benchmarked the warmed end-to-end CLI path that this change targets:
cargo-nextest nextest list --workspace --all-targets --list-type binaries-only \ --cargo-message-format json --cargo-quiet >/dev/nullusing
hyperfine --warmup 5 --runs 20on two external repositories:tokio(e67cd87):426.3 ms ± 37.3 msbefore,400.6 ms ± 10.6 msafter, about6.0%fasterrust-analyzer(51966da):426.4 ms ± 36.4 msbefore,400.6 ms ± 11.9 msafter, about6.1%fasterThese runs intentionally benchmark the Cargo-JSON-forwarding
listpath, since that is the path changed by this patch.