Skip to content

Commit

Permalink
Merge pull request #1115 from RReverser/patch-1
Browse files Browse the repository at this point in the history
Update Wasm section of README
  • Loading branch information
cuviper authored Jan 23, 2024
2 parents 7df6d5b + a6dc86f commit f5eb95f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,19 @@ Rayon currently requires `rustc 1.63.0` or greater.

### Usage with WebAssembly

Rayon can work on the Web via WebAssembly, but requires an adapter and
some project configuration to account for differences between
WebAssembly threads and threads on the other platforms.
By default, when building to WebAssembly, Rayon will treat it as any
other platform without multithreading support and will fall back to
sequential iteration. This allows existing code to compile and run
successfully with no changes necessary, but it will run slower as it
will only use a single CPU core.

You can build Rayon-based projects with proper multithreading support
for the Web, but you'll need an adapter and some project configuration
to account for differences between WebAssembly threads and threads
on the other platforms.

Check out the
[wasm-bindgen-rayon](https://github.com/GoogleChromeLabs/wasm-bindgen-rayon)
[wasm-bindgen-rayon](https://github.com/RReverser/wasm-bindgen-rayon)
docs for more details.

## Contribution
Expand Down

0 comments on commit f5eb95f

Please sign in to comment.