rayon: Parallelize Rust Computations Safely

Summary
Rayon is a Rust library for parallelizing data processing and independent tasks while preserving data-race freedom. It suits Rust developers who want to use multiple CPU cores with familiar iterator-style code or explicit task control.
At a glance
- Language
- Rust
- License
- Apache-2.0
- Stars
- 13.4k
- Forks
- 613
- Added to OSRepos
- March 12, 2026
- Last analyzed
- October 3, 2026
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Overview
Rayon helps Rust developers run suitable computations across multiple CPU cores without manually managing the division of work. Its parallel iterator APIs let you adapt many sequential iterator workflows, while task APIs provide more control when needed.
Rayon is a good fit when a workload can be split into independent pieces and you want Rust's type system to help prevent data races. It does not make every computation faster: the work must benefit from parallel execution, and side effects may happen in a different order.
Key Features
- Parallel iterator APIs for processing collections and other supported data in parallel.
- Work is divided into tasks and dynamically adapted by the parallel iterator machinery.
joinandscopeAPIs for creating parallel tasks directly.- Custom thread pools for applications that need control beyond the default global pool.
- APIs guarantee data-race freedom.
- Parallel iterator results generally match sequential results, subject to caveats such as side-effect ordering.
- On WebAssembly without multithreading support, parallel iteration falls back to sequential execution.
Use Cases
- Rust developers can parallelize CPU-heavy collection operations, such as mapping values and aggregating results.
- Scientific or simulation software can distribute independent calculations across cores.
- Applications with multiple independent tasks can use
joinorscoperather than limiting parallelism to iterator pipelines. - Projects that need isolated or specifically configured worker pools can create custom thread pools.
Project Facts
- Language: Rust
- License: Apache-2.0
- Stars: 13.4k
- Forks: 613
- Archived: No
Getting Started
Add Rayon to Cargo.toml:
[dependencies]
rayon = "1.12"
Import the prelude with use rayon::prelude::*; to access parallel iterator APIs. See the README for examples, WebAssembly guidance, and contribution details.
Considerations
- Requires
rustc 1.85.0or greater. - Parallel execution is not guaranteed to improve performance. It is most useful when work can be divided effectively and the parallel overhead is worthwhile.
- Side effects in parallel iterators can occur in a different order than in sequential execution.
- WebAssembly builds without multithreading support run sequentially by default. Multithreaded WebAssembly requires an adapter and additional configuration.
- Data-race freedom does not rule out every kind of parallel-programming bug.
Source repository
Open the original repository on GitHub.
27 counted GitHub visits
Related repositories
Similar repositories that may be relevant next.

skillrank: Find and Evaluate AI-Agent Skills
October 4, 2026
SkillRank is a Rust CLI for discovering, installing, and evaluating skills used by coding agents. Its paired local evaluations compare a skill-enabled run with a control to show changes in success, tokens, time, and cost.

prime-agent: Run Self-Improving Agents for Coding Work
October 2, 2026
Prime Agent is a coding and research agent built for long-running tasks, using a persistent Python environment, recursive subagents, and durable working context. It suits developers and researchers who need agents to keep working across sessions.

SwarmLLM: Run Local and Distributed AI Models
October 2, 2026
SwarmLLM runs open AI models on your computer and can pool resources with other computers to run larger models. It also provides OpenAI- and Anthropic-compatible APIs for local apps and agents.

OpenCompany: Coordinate AI Agents to Run a One-Person Business
September 30, 2026
OpenCompany is a Rust-based host for configuring and running companies staffed by coordinated AI agents. It is aimed at solo operators who want to delegate business functions while retaining key decisions, and is explicitly not production-ready.