Skip to content

Add a little rayon#14

Draft
JaminKoke wants to merge 1 commit intoBorgerLand:masterfrom
JaminKoke:rayon
Draft

Add a little rayon#14
JaminKoke wants to merge 1 commit intoBorgerLand:masterfrom
JaminKoke:rayon

Conversation

@JaminKoke
Copy link
Copy Markdown
Contributor

Was thinking about this because spheres were taking a while to generate in the test suite.

As of now I don't have numbers to compare speeds with, and I also haven't added the "autoPolicy" thing yet.
This is not adding it to everything, but just in a few places that were easy enough to do.

@JaminKoke JaminKoke mentioned this pull request Dec 12, 2025
@luisfonsivevo
Copy link
Copy Markdown
Member

Most of my Rust experience so far has been for the WASM compilation target, AKA browser, where multithreading support is very limited. For that reason, I've never used Rayon and can't really advise on how to best integrate it, but it would be amazing to have for wider adoption of the library. This PR makes it look promising and trivial.

The only opinion I can offer is that we can hide the Rayon dependency behind a feature flag. For most browser use cases it can't be used anyway and so just bloats the web page download size. If Rayon has something like a "single thread only" mode that adds a negligible amount of data to the build size, that might be a better option for cleaner code to avoid having separate Rayon/non-Rayon codepaths.

I would also like to understand how close Rayon is to a drop in replacement for C++'s Thread Building Blocks. My fear is that Rust's exclusive mutability rule may make a lot of Manifold's optimizations infeasible to port.

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.

2 participants