Skip to content

Commit

Permalink
chore: Add controlling pararellism section into README
Browse files Browse the repository at this point in the history
  • Loading branch information
CPerezz committed Jan 4, 2024
1 parent c32ec19 commit 4c0f100
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ The implementations were originally ported from [matterlabs/pairing](https://git
* Various features related to serialization and deserialization of curve points and field elements.
* Curve-specific optimizations and benchmarking capabilities.

## Controlling parallelism

`halo2curves` currently uses [rayon](https://github.com/rayon-rs/rayon) for parallel
computation. The `RAYON_NUM_THREADS` environment variable can be used to set the number of
threads.

You can disable `rayon` by disabling the `"multicore"` feature.
Warning! halo2curves will lose access to parallelism if you disable the `"multicore"` feature.
This will significantly degrade performance.

Notice that if the `multicore` feature is active, the library will not compile to any `wasm` target.
This is because WASM architectures at the time of writing this still don't handle parallelism properly.
See: [Rayon: Usage with WwbAssembly](https://github.com/rayon-rs/rayon#usage-with-webassembly) for more info.

## Benchmarks

Benchmarking is supported through the use of Rust's built-in test framework. Benchmarks can be run without assembly optimizations:
Expand Down

0 comments on commit 4c0f100

Please sign in to comment.