You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use web_worker to create a new rayon::ThreadPool to enable parallelization on wasm.
The wasm app will need a initialization for the global ThreadPool, so probably something like this:
fnset_global_pool_to_web_workers(){let concurrency = match web_sys::window(){Some(window) => window.navigator().hardware_concurrency()asusize,None => {console_log!("Failed to get hardware concurrency from window. This function is only available in the main browser thread.");2}};let worker_pool = pool::WorkerPool::new(concurrency);
rayon::ThreadPoolBuilder::new().num_threads(concurrency).spawn_handler(|thread| Ok(pool.run(|| thread.run()).unwrap())).build()?;}
cc @kobigurk@howardwu, this is of interest for speeding up proving and setup ceremonies in the browser.
The text was updated successfully, but these errors were encountered:
Use
web_worker
to create a newrayon::ThreadPool
to enable parallelization onwasm
.The
wasm
app will need a initialization for the global ThreadPool, so probably something like this:cc @kobigurk @howardwu, this is of interest for speeding up proving and setup ceremonies in the browser.
The text was updated successfully, but these errors were encountered: