Parallelise formatting files and projects
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
I see two ways to parallelise rustfmt pretty easily: in cargo-fmt, run the rustfmt processes in parallel, rather than sequentially (up to a max of the number of cores). This should be pretty trivial to do. And inside rustfmt, format multiple files at a time (spawning one thread per queue). This is a bit more difficult since we'll need to use a thread pool and we'll need to make the Rustfmt state thread-safe. There second will probably work better and if we do that, then we probably shouldn't also do multi-process cargo-fmt.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the cargo-fmt process flow with rustfmt's internal formatting flow, focusing on where files or projects are currently handled sequentially. Determine which parallelisation approach is viable and what state must be made thread-safe. Done means formatting work can run concurrently with bounded resource use without changing formatting results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100