4 ms·
Wow. Have you tried moving particularly hot portions of code to WebAssembly yet? Obviously in Photopea's case this would generally require rewriting portions
by exikyut 7y ago
Wow.
Have you tried moving particularly hot portions of code to WebAssembly yet?
Obviously in Photopea's case this would generally require rewriting portions of the code in C/C++/Rust, and potentially doing a few iterations of looking at the generated WASM and tweaking the input to produce the best (maintainable) results... so a bit of a long-term project :)
Whenever you get to this, I'm sure a lot of people would appreciate a benchmark post with
speedup percentages etc.
And WASM is so new that maybe sharing some of the approaches you used, the JS you started with, and the C/C++/Rust/etc you ended up with, might also attract folks looking for assistance with their own image-processing-related projects. (This being said... translation: I, like lots of others, am extremely interested in the bits of code that make Photopea so efficient, which you worked hard to perfect and have every right to not share :D)
- IvanK_net 7y agoHi, thanks! I think the JS that I write is quite efficient and I don't expect the WASM version of the same features to be faster. But I do plan to write something in WASM and see for myself (you don't have to write in C, you can write WAST and convert it to WASM :D). I open-sourced many parts of Photopea: https://github.com/photopea?tab=repositories https://github.com/photopea?tab=repositories .