-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make parallelization customizable (for wasm) #148
Comments
The library is not yet tested on wasm, but it is a goal. Apart from switching parallelism off, what else is required for wasm? Maybe switching off functions with file paths? Using concurrency is already optional in the library, we would only have to disable the rayon dependency and some type definitions, in order to use single-threaded exr on wasm |
File IO I've already worked around with the buffered loading, which I think is fine for now. How would I switch of concurrency? |
Perhaps using this could work: https://github.com/GoogleChromeLabs/wasm-bindgen-rayon |
I see I could get it to work using "non_parallel()".... but it takes forever to load the EXR compared to the same code running natively. |
Excellent! So it's simply enough to not use the path-based functions? I thought it would be necessary to remove the functions when compiling for wasm. Nice!
The library uses rayon only for testing purposes, the runtime code uses |
Here's an article about threading in wasm: Seems like it will not be simple. Even if the parallelization mechanics in exrs were customizable, it would be quite the hassle to make threads work at all |
Not sure why, but it seems like my wasm was somehow broken. I managed to rebuild it again, and now it's almost as fast as the native binary. So actually not having threading at load is not a problem after all. Thanks your help! |
Awesome! The loading time depends on whether the file uses exr compression, and of course the image size. Uncompressed images should be unaffected by parallelism. RLE compression is fastest, PIZ is reasonably fast, and the other compression types use the zip algorithm, which takes quite some time |
Leaving this issue open as a reminder to add parallelization customization :) |
Hi!
Trying to load an exr in WASM. It could look like it fails due to threadpool being used in the exr lib?
Perhaps I am just missing some setting in the toml?
Thanks!
The text was updated successfully, but these errors were encountered: