kornelski / dssim

Image similarity comparison simulating human perception (multiscale SSIM in Rust)
https://kornel.ski/dssim
GNU Affero General Public License v3.0
1.09k stars 70 forks source link

Cannot be used for WASM because of multithreading? #114

Closed liafuzho closed 2 years ago

liafuzho commented 2 years ago

When I call "create_image" function in WASM It's frustrating to get an error and exit.

kornelski commented 2 years ago

Unfortunately

In browsers that support threads, maybe this will work: https://github.com/GoogleChromeLabs/wasm-bindgen-rayon

kornelski commented 2 years ago

Done in 3.2.0. Disable the threads feature.

RReverser commented 1 year ago

In browsers that support threads, maybe this will work: https://github.com/GoogleChromeLabs/wasm-bindgen-rayon

FWIW this also should work indeed and usually provides noticeable perf improvements, like multithreading on any other platform. Although it does require a bit of fiddling with configs.