Open f321x opened 1 month ago
Hello!
The demo provided is already multithreaded, but is achieved with web-workers as opposed to inside the wasm with rayon.
I considered using rayon but opted for multi-threading via web-workers instead in order to keep the wasm simple and to have wider compatbililty.
Rayon would definitely simplify usage of notemine, but it also could have some accessibility gotchyas with browser support (here and here). When compared with the accessibility of web workers, it's clear that notemine has notably wider coverage for multithreaded mining by implementing web-workers.
Additionally, based on the demo you sent, I'm not seeing much of a performance benefit over the web-worker implementation, both have a simliar end result (singleThreadPerf*totalThreads
)
That said, I'm definitely not opposed to having another build with rayon implemented!
If it is possible to parallelize functions in wasm libraries with something like https://github.com/RReverser/wasm-bindgen-rayon it would probably provide a great speed improvement to the note hashing. Demo: https://rreverser.com/wasm-bindgen-rayon-demo/