Skip to content

Rayon support#153

Open
DenialAdams wants to merge 1 commit into
orlp:masterfrom
DenialAdams:rayonFinal
Open

Rayon support#153
DenialAdams wants to merge 1 commit into
orlp:masterfrom
DenialAdams:rayonFinal

Conversation

@DenialAdams

Copy link
Copy Markdown

Support parallel iteration via a new rayon feature. Fixes #98.

AI Disclosure: I prototyped this change with codex. When preparing this PR, I rewrote the change by hand to better match the existing codebase and improve on a few things. I had codex review the final change.

Implementation notes:

  • The dep: syntax in Cargo.toml requires Rust 1.60. Alternatives seemed ugly, so I bumped the MSRV slightly.
  • Cargo.lock was updated via cargo +nightly update -Z direct-minimal-versions
  • Supported methods: par_iter, par_iter_mut, into_par_iter, par_keys, par_values, par_values_mut
  • I skipped supporting HopSlotMap since it is deprecated. I skipped SparseSecondaryMap for now since it has more complicated internals and I don't personally have a use-case for it.
  • I implemented ParallelIterator for the SlotMap and SecondaryMap iterators. For DenseSlotMap we can also implement IndexedParallelIterator as the iteration maps 1:1 with the underlying data.
  • I tried to match the structure of the sequential iterators where possible. In some cases, a slightly different structure allowed for relaxed trait bounds on the parallel iterators and so in those cases there is some deviation.

Let me know if there is anything you'd like me to change.

Thanks you!

@DenialAdams DenialAdams mentioned this pull request May 27, 2026
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.

Add rayon support

1 participant