rayon-core
Core APIs for Rayon
1.13.0
498M downloads/mo
#225 most downloaded on crates.io
rayon-rs/rayon
What this package is like to depend on
Last release 1 years ago
12 Aug 2025
Release timing varies
gaps range from 3 weeks to 1.6 years
Most releases are documented
notes for 23 of 27 stable releases
1 version withdrawn
withdrawn after publishing
9 years old
28 releases · first in 2017
0 releases in the last 12 months
see the full history below
Release timeline
28 releases · Mar 2017 to Aug 2025Releases
latest 28-
1.13.012 Aug 2025Release notes
Open source →- The minimum supported
rustcis now 1.80. iter::repeatnhas been renamed toiter::repeat_nto match the name stabilized in the standard library. The old name still exists as a deprecated function for compatibility.- Fixed a bug in
in_place_scopewhen the default global registry uses the current thread, like on WebAssembly without threading support. binary_heap::Iterno longer requires a temporary allocation.- Relaxed trait bounds on many of the public structs.
- Implemented
IntoParallelIterator for Box<[T]>and its references. - Implemented
FromParallelIterator<_> for Box<str>viaString.
- The minimum supported
-
1.12.117 Jan 2024Release notes
Open source →- The new
"web_spin_lock"crate feature makes mutexes spin on the main browser thread in WebAssembly, rather than suffer an error about forbiddenatomics.waitif they were to block in that context. Thanks @RReverser!
- The new
-
1.12.020 Sep 2023Release notes
Open source →- Fixed a bug in parallel
Range<char>when the end is 0xE000, just past the surrogate boundary, which was unsafely producing invalidcharvalues. - The new method
ParallelSlice::par_array_windowsworks likepar_windowsbut with a constant length, producing&[T; N]items.
- Fixed a bug in parallel
-
1.11.004 Mar 2023Release notes
Open source →- The minimum supported
rustcis now 1.59. - Added a fallback when threading is unsupported.
- The new
ParallelIterator::take_anyandskip_anymethods work like unorderedIndexedParallelIterator::takeandskip, counting items in whatever order they are visited in parallel. - The new
ParallelIterator::take_any_whileandskip_any_whilemethods work like unorderedIterator::take_whileandskip_while, which previously had no parallel equivalent. The "while" condition may be satisfied from anywhere in the parallel iterator, affecting all future items regardless of position. - The new
yield_nowandyield_localfunctions will cooperatively yield execution to Rayon, either trying to execute pending work from the entire pool or from just the local deques of the current thread, respectively.
- The minimum supported
-
1.10.222 Jan 2023 -
1.10.119 Nov 2022Release notes
Open source →- Fixed a race condition with threads going to sleep while a broadcast starts.
-
1.10.018 Nov 2022Release notes
Open source →- The new methods
ParallelSlice::par_chunk_byandParallelSliceMut::par_chunk_by_mutwork like the slice methodschunk_byandchunk_by_mutadded in Rust 1.77.
- The new methods
-
1.9.313 May 2022 -
1.9.214 Apr 2022Release notes
Open source →- The new
ParallelSlice::par_rchunks()andpar_rchunks_exact()iterate slice chunks in reverse, aligned the against the end of the slice if the length is not a perfect multiple of the chunk size. The newParallelSliceMut::par_rchunks_mut()andpar_rchunks_exact_mut()are the same for mutable slices. - The
ParallelIterator::try_*methods now supportstd::ops::ControlFlowandstd::task::Pollitems, mirroring the unstableTryimplementations in the standard library. - The
ParallelStringpattern-based methods now support&[char]patterns, which match when any character in that slice is found in the string. - A soft limit is now enforced on the number of threads allowed in a single
thread pool, respecting internal bit limits that already existed. The current
maximum is publicly available from the new function
max_num_threads(). - Fixed several Stacked Borrow and provenance issues found by
cargo miri.
Contributors
Thanks to all of the contributors for this release!
- @atouchet
- @bluss
- @cuviper
- @fzyzcjy
- @nyanzebra
- @paolobarbolini
- @RReverser
- @saethlin
- The new
-
1.9.118 May 2021Release notes
Open source →- The new
in_place_scopeandin_place_scope_fifoare variations ofscopeandscope_fifo, running the initial non-Sendcallback directly on the current thread, rather than moving execution to the thread pool. - With Rust 1.51 or later, arrays now implement
IntoParallelIterator. - New implementations of
FromParallelIteratormake it possible tocollectcomplicated nestings of items.FromParallelIterator<(A, B)> for (FromA, FromB)works likeunzip.FromParallelIterator<Either<L, R>> for (A, B)works likepartition_map.
- Type inference now works better with parallel
RangeandRangeInclusive. - The implementation of
FromParallelIteratorandParallelExtendforVec<T>now usesMaybeUninit<T>internally to avoid creating any references to uninitialized data. ParallelBridgefixed a bug with threads missing available work.
Contributors
Thanks to all of the contributors for this release!
- @atouchet
- @cuviper
- @Hywan
- @iRaiko
- @Qwaz
- @rocallahan
- The new
-
1.9.021 Oct 2020Release notes
Open source →- The new methods
IndexedParallelIterator::by_exponential_blocksandby_uniform_blocksallow processing items in smaller groups at a time. - The new
iter::walk_tree,walk_tree_prefix, andwalk_tree_postfixfunctions enable custom parallel iteration over tree-like structures. - The new method
ParallelIterator::collect_vec_listreturns items as a linked list of vectors, which is an efficient mode of parallel collection used by many of the internal implementations ofcollect. - The new methods
ParallelSliceMut::par_split_inclusive_mut,ParallelSlice::par_split_inclusive, andParallelString::par_split_inclusiveall work like a normal split but keeping the separator as part of the left slice. - The new
ParallelString::par_split_ascii_whitespacesplits only on ASCII whitespace, which is faster than including Unicode multi-byte whitespace. OsStringnow implementsFromParallelIterator<_>andParallelExtend<_>for a few item types similar to the standardFromIteratorandExtend.- The internal
Patterntrait for string methods is now implemented for[char; N]and&[char; N], matching any of the given characters.
- The new methods
-
1.8.117 Sep 2020Release notes
Open source →- Fixed an overflow panic on high-contention workloads, for a counter that was meant to simply wrap. This panic only occurred with debug assertions enabled, and was much more likely on 32-bit targets.
-
1.8.024 Aug 2020Release notes
Open source →- Implemented a new thread scheduler, RFC 5, which uses targeted wakeups for new work and for notifications of completed stolen work, reducing wasteful CPU usage in idle threads.
- Implemented
IntoParallelIterator for Range<char>andRangeInclusive<char>with the same iteration semantics as Rust 1.45. - Relaxed the lifetime requirements of the initial
scopeclosure.
Contributors
Thanks to all of the contributors for this release!
- @CAD97
- @cuviper
- @kmaork
- @nikomatsakis
- @SuperFluffy
-
1.7.115 Jun 2020Release notes
Open source →- Fixed a use-after-free race in calls blocked between two rayon thread pools.
- Collecting to an indexed
Vecnow drops any partial writes while unwinding, rather than just leaking them. If dropping also panics, Rust will abort.- Note: the old leaking behavior is considered safe, just not ideal.
- The new
IndexedParallelIterator::step_by()adapts an iterator to step through items by the given count, likeIterator::step_by(). - The new
ParallelSlice::par_chunks_exact()and mutable equivalentParallelSliceMut::par_chunks_exact_mut()ensure that the chunks always have the exact length requested, leaving any remainder separate, like the slice methodschunks_exact()andchunks_exact_mut().
Contributors
Thanks to all of the contributors for this release!
- @adrian5
- @bluss
- @cuviper
- @FlyingCanoe
- @GuillaumeGomez
- @matthiasbeyer
- @picoHz
- @zesterer
-
1.7.022 Dec 2019Release notes
Open source →- Tuples up to length 12 now implement
IntoParallelIterator, creating aMultiZipiterator that produces items as similarly-shaped tuples. - The
--cfg=rayon_unstablesupporting code forrayon-futuresis removed. - The minimum supported
rustcis now 1.31.
Contributors
Thanks to all of the contributors for this release!
- @cuviper
- @c410-f3r
- @silwol
- Tuples up to length 12 now implement
-
1.6.121 Nov 2019Release notes
Open source →- Simplified
par_bridgeto only pull one item at a time from the iterator, without batching. Threads that are waiting for iterator items will now block appropriately rather than spinning CPU. (Thanks @njaard!) - Added protection against recursion in
par_bridge, so iterators that also invoke rayon will not cause mutex recursion deadlocks.
- Simplified
-
1.6.031 Aug 2019Release notes
Open source →- The new
ParallelIterator::copied()converts an iterator of references into copied values, likeIterator::copied(). ParallelExtendis now implemented for the unit().- Internal updates were made to improve test determinism, reduce closure type sizes, reduce task allocations, and update dependencies.
- The minimum supported
rustcis now 1.28.
Contributors
Thanks to all of the contributors for this release!
- @Aaron1011
- @cuviper
- @ralfbiedert
- The new
-
1.5.013 Jun 2019Release notes
Open source →- FIFO spawns are now supported using the new
spawn_fifo()andscope_fifo()global functions, and their correspondingThreadPoolmethods.- Normally when tasks are queued on a thread, the most recent is processed first (LIFO) while other threads will steal the oldest (FIFO). With FIFO spawns, those tasks are processed locally in FIFO order too.
- Regular spawns and other tasks like
joinare not affected. - The
breadth_firstconfiguration flag, which globally approximated this effect, is now deprecated. - For more design details, please see RFC 1.
ThreadPoolBuildercan now take a customspawn_handlerto control how threads will be created in the pool.ThreadPoolBuilder::build_scoped()uses this to create a scoped thread pool, where the threads are able to use non-static data.- This may also be used to support threading in exotic environments, like
WebAssembly, which don't support the normal
std::thread.
ParallelIteratorhas 3 new methods:find_map_any(),find_map_first(), andfind_map_last(), likeIterator::find_map()with ordering constraints.- The new
ParallelIterator::panic_fuse()makes a parallel iterator halt as soon as possible if any of its threads panic. Otherwise, the panic state is not usually noticed until the iterator joins its parallel tasks back together. IntoParallelIteratoris now implemented for integralRangeInclusive.- Several internal
Folders now have optimizedconsume_iterimplementations. rayon_core::current_thread_index()is now re-exported inrayon.- The minimum
rustcis now 1.26, following the update policy defined in RFC 3.
Contributors
Thanks to all of the contributors for this release!
- @cuviper
- @didroe
- @GuillaumeGomez
- @huonw
- @janriemer
- @kornelski
- @nikomatsakis
- @seanchen1991
- @yegeun542
- FIFO spawns are now supported using the new
-
1.4.117 Jul 2018Release notes
Open source →- The new
flat_map_iterandflatten_itermethods can be used to flatten sequential iterators, which may perform better in cases that don't need the nested parallelism offlat_mapandflatten. - The new
par_drainmethod is a parallel version of the standarddrainfor collections, removing items while keeping the original capacity. Collections that implement this throughParallelDrainRangesupport draining items from arbitrary index ranges, whileParallelDrainFullalways drains everything. - The new
positionsmethod finds all items that match the given predicate and returns their indices in a new iterator.
- The new
-
1.4.015 Feb 2018Release notes
Open source →ParallelIteratoradded theupdatemethod which applies a function to mutable references, inspired byitertools.IndexedParallelIteratoradded thechunksmethod which yields vectors of consecutive items from the base iterator, inspired byitertools.Stringnow implementsFromParallelIterator<Cow<str>>andParallelExtend<Cow<str>>, inspired bystd.()now implementsFromParallelIterator<()>, inspired bystd.- The new
ThreadPoolBuilderreplaces and deprecatesConfiguration.- Errors from initialization now have the concrete
ThreadPoolBuildErrortype, rather thanBox<Error>, and this type implementsSendandSync. ThreadPool::newis deprecated in favor ofThreadPoolBuilder::build.initializeis deprecated in favor ofThreadPoolBuilder::build_global.
- Errors from initialization now have the concrete
- Examples have been added to most of the parallel iterator methods.
- A lot of the documentation has been reorganized and extended.
Breaking changes
- Rayon now requires rustc 1.13 or greater.
IndexedParallelIterator::lenandParallelIterator::opt_lennow operate on&selfinstead of&mut self.IndexedParallelIterator::collect_intois nowcollect_into_vec.IndexedParallelIterator::unzip_intois nowunzip_into_vecs.- Rayon no longer exports the deprecated
Configurationandinitializefrom rayon-core.
Contributors
Thanks to all of the contributors for this release!
- @Bilkow
- @cuviper
- @Enet4
- @ignatenkobrain
- @iwillspeak
- @jeehoonkang
- @jwass
- @Kerollmops
- @KodrAus
- @kornelski
- @MaloJaffre
- @nikomatsakis
- @obv-mikhail
- @oddg
- @phimuemue
- @stjepang
- @tmccombs
- bors[bot]
-
1.3.009 Nov 2017Nothing published for this version
-
1.2.115 Jun 2017Nothing published for this version
-
1.2.014 Jun 2017Release notes
Open source →- The following core APIs are being stabilized:
rayon::spawn()-- spawns a task into the Rayon thread pool; as it is contained in the global scope (rather than a user-created scope), the task cannot capture anything from the current stack frame.ThreadPool::join(),ThreadPool::spawn(),ThreadPool::scope()-- convenience APIs for launching new work within a thread pool.
- The various iterator adapters are now tagged with
#[must_use] - Parallel iterators now offer a
for_each_withadapter, similar tomap_with. - We are adopting a new approach to handling the remaining unstable
APIs (which primarily pertain to futures integration). As awlays,
unstable APIs are intended for experimentation, but do not come with
any promise of compatibility (in other words, we might change them
in arbitrary ways in any release). Previously, we designated such
APIs using a Cargo feature "unstable". Now, we are using a regular
#[cfg]flag. This means that to see the unstable APIs, you must doRUSTFLAGS='--cfg rayon_unstable' cargo build. This is intentionally inconvenient; in particular, if you are a library, then your clients must also modify their environment, signaling their agreement to instability.
- The following core APIs are being stabilized:
-
1.1.013 Jun 2017Release notes
Open source →Rayon 0.8.0
- Added the
map_withandfold_withcombinators, which help for passing along state (like channels) that cannot be shared between threads but which can be cloned on each thread split. - Added the
while_somecombinator, which helps for writing short-circuiting iterators. - Added support for "short-circuiting" collection: e.g., collecting
from an iterator producing
Option<T>orResult<T, E>into aOption<Collection<T>>orResult<Collection<T>, E>. - Support
FromParallelIteratorforCow. - Removed the deprecated weight APIs.
- Simplified the parallel iterator trait hierarchy by removing the
BoundedParallelIteratorandExactParallelIteratortraits, which were not serving much purpose. - Improved documentation.
- Added some missing
Sendimpls. - Fixed some small bugs.
Rayon-core 1.1.0
- We now have more documentation.
- Renamed the (unstable) methods
spawn_asyncandspawn_future_async-- which spawn tasks that cannot hold references -- to simplyspawnandspawn_future, respectively. - We are now using the coco library for our deque.
- Individual thread pools can now be configured in "breadth-first" mode, which causes them to execute spawned tasks in the reverse order that they used to. In some specific scenarios, this can be a win (though it is not generally the right choice).
- Added top-level functions:
current_thread_index, for querying the index of the current worker thread within its thread pool (previously available asthread_pool.current_thread_index());current_thread_has_pending_tasks, for querying whether the current worker that has an empty task deque or not. This can be useful when deciding whether to spawn a task.
- The environment variables for controlling Rayon are now
RAYON_NUM_THREADSandRAYON_LOG. The older variables (e.g.,RAYON_RS_NUM_CPUSare still supported but deprecated).
Rayon-demo
- Added a new game-of-life benchmark.
Contributors
Thanks to the following contributors:
- @ChristopherDavenport
- @SuperFluffy
- @antoinewdg
- @crazymykl
- @cuviper
- @glandium
- @julian-seward1
- @leodasvacas
- @leshow
- @lilianmoraru
- @mschmo
- @nikomatsakis
- @stjepang
- Added the
-
1.0.230 May 2017Release notes
Open source →This release is a targeted performance fix for #343, an issue where rayon threads could sometimes enter into a spin loop where they would be unable to make progress until they are pre-empted.
-
1.0.130 May 2017 withdrawnRelease notes
Open source →- Added more documentation for
rayon::iter::split(). - Corrected links and typos in documentation.
Contributors
Thanks to all of the contributors for this release!
- @cuviper
- @HadrienG2
- @matthiasbeyer
- @nikomatsakis
- Added more documentation for
-
1.0.006 Apr 2017Nothing published for this version
-
0.0.111 Mar 2017Nothing published for this version