Skip to content

implement xargs -P using rayon and a spin lock#653

Open
asakatida wants to merge 1 commit intouutils:mainfrom
asakatida:push-zlxwkxlkpsls
Open

implement xargs -P using rayon and a spin lock#653
asakatida wants to merge 1 commit intouutils:mainfrom
asakatida:push-zlxwkxlkpsls

Conversation

@asakatida
Copy link
Copy Markdown

if this is accepted then I could do #112 in a similar way

batches
.par_bridge()
.map(|batch| batch?.execute_parallel(capacity).map_err(XargsError::from))
.collect()
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is meat of the change, the other option here to avoid would be to build the thread pool directly which would avoid needing a lock but I feel the impl Iterator is a cleaner abstraction and is in line with rayon advice

@asakatida asakatida force-pushed the push-zlxwkxlkpsls branch from 61aae5c to e175c3c Compare April 8, 2026 09:40
@asakatida
Copy link
Copy Markdown
Author

if more tests are desired then I have a branch ready to push

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

❌ Patch coverage is 70.24793% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.32%. Comparing base (1266b7f) to head (e175c3c).

Files with missing lines Patch % Lines
src/xargs/mod.rs 70.24% 32 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #653      +/-   ##
==========================================
- Coverage   91.76%   91.32%   -0.44%     
==========================================
  Files          31       31              
  Lines        6203     6283      +80     
  Branches      328      329       +1     
==========================================
+ Hits         5692     5738      +46     
- Misses        390      422      +32     
- Partials      121      123       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant