anthropics/rayon
forked from rayon-rs/rayon
Captured source
source ↗anthropics/rayon
Description: Rayon: A data parallelism library for Rust
License: Apache-2.0
Stars: 0
Forks: 0
Open issues: 0
Created: 2026-07-22T14:26:16Z
Pushed: 2026-07-22T14:42:10Z
Default branch: main
Fork: yes
Parent repository: rayon-rs/rayon
Archived: no
README:
Rayon
 
Rayon is a data-parallelism library for Rust. It is extremely lightweight and makes it easy to convert a sequential computation into a parallel one. It also guarantees data-race freedom. (You may also enjoy [this blog post][blog] about Rayon, which gives more background and details about how it works, or [this video][video], from the Rust Belt Rust conference.) Rayon is available on crates.io, and API documentation is available on docs.rs.
[blog]: https://smallcultfollowing.com/babysteps/blog/2015/12/18/rayon-data-parallelism-in-rust/ [video]: https://www.youtube.com/watch?v=gof_OEv71Aw
Parallel iterators and more
Rayon makes it drop-dead simple to convert sequential iterators into parallel ones: usually, you just change your foo.iter() call into foo.par_iter(), and Rayon does the rest:
use rayon::prelude::*;
fn sum_of_squares(input: &[i32]) -> i32 {
input.par_iter() // cd rayon-demo
> cargo run --release -- nbody visualizeFor more information on demos, try:
> cd rayon-demo > cargo run --release -- --help
Other questions?
See [the Rayon FAQ][faq].
[faq]: https://github.com/rayon-rs/rayon/blob/main/FAQ.md
License
Rayon is distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details. Opening a pull request is assumed to signal agreement with these licensing terms.
Excerpt shown — open the source for the full document.