Request: WASM implementation of the LERC decoder
Closed this issue · 4 comments
Compared with the existing JS, WASM should have significantly higher performance for something as compute intensive as a data/image compression.
@lucianpls According to https://en.wikipedia.org/wiki/WebAssembly/
there are ways to compile C/C++ to Wasm: " ... a standalone Clang can compile C and C++ to Wasm". So a Wasm Lerc decoder might take less work than a JS Lerc decoder.
@lucianpls Another update. Using https://emscripten.org/ I could compile the entire repo into wasm and run it in a browser. The wasm decoder is about 50% slower than the C++ decoder. Still needs more testing etc but looking good.
Nice, although it should be better than that. Some browsers need to run the WASM code a few times in the interpreter before converting it to native code. The technology is evolving too.
It's also best to avoid calls between JS and Wasm as much as possible.