implement xargs -P using rayon and a spin lock - #794
Open
codspeed-hq[bot] wants to merge 2 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #794 +/- ##
==========================================
+ Coverage 91.89% 92.74% +0.85%
==========================================
Files 35 35
Lines 7217 7751 +534
Branches 376 461 +85
==========================================
+ Hits 6632 7189 +557
+ Misses 442 419 -23
Partials 143 143 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Commit 017bea8 has test result changes: GNU findutils testsuite: bfs testsuite: |
Author
Merging this PR will not alter performance
Performance Changes
Comparing |
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.
Add CodSpeed benchmarks for the parallel
xargs -PpathThis PR introduces parallel execution for
xargs -P(viarayon), but the existing benchmark suite (benches/xargs_bench.rs) only exercised the serial path — so CodSpeed reported the new code as untouched.This change extends
benches/xargs_bench.rswith three benchmarks that drive the new rayon-based dispatch inprocess_input:parallel_p2—-n 10 -P 2: a low degree of parallelism. This is the spin-lock worst case noted earlier in the review (high contention between two workers).parallel_p8—-n 10 -P 8: higher parallelism, exercising the scheduler under more contention.parallel_p8_batched_n—-n 50 -P 8: fewer, larger batches so the balance shifts back toward argument assembly while still going through the parallel bridge.Implementation notes
truechild, so a smaller corpus keeps the number of spawns reasonable under the CodSpeed simulation instrument while still producing enough batches to feed the parallel bridge.split_whitespace,split_null,batched_n,batched_size) are unchanged.xargs's own work (reading, splitting, batching, and parallel dispatch); child-process spawns are not traced under simulation.All benchmarks build and run successfully under
codspeed run --mode simulation.