From 4c0f1008e019a9e539fc014372f6ea276ee68d4f Mon Sep 17 00:00:00 2001 From: CPerezz Date: Thu, 4 Jan 2024 14:57:42 +0100 Subject: [PATCH] chore: Add controlling pararellism section into README --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 3ede071c..800358bd 100644 --- a/README.md +++ b/README.md @@ -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: