-
Notifications
You must be signed in to change notification settings - Fork 139
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
Very slow performances in WebAssembly (wasm) #114
Comments
No, but looks like the leaf functions are dominantly in the |
Yes, here is the corresponding profile. |
I fear I have no idea how to interpret this. What do I need to be able to explore it just like in that image? Which tools did you use to profile? Etc. |
This is chromium dev tools that I used. If you unzip the file. You can load it in chromium/chrome dev tools in the performance tab, load profile button. |
Thanks, didn't know you can simply load one that way :) So, the hard numbers important here are (everything in percent of the total time):
So the runtime is indeed dominated by the time of |
Ok I'll try to see if I can do some similar minimalist wasm example for the inflate crate to figure out what is going on there. Thanks for your time! |
@mpizenberg Maybe after an optimization in |
I've been rewriting a PNG decoder because diving into the png crate was not the easiest. It doesn't cover all the spec but works for images without palette or interlaced data. It relies on miniz_oxide for the inflating code. The performance of the decoding code is great, especially for images with a majority of
I hope this can also help improving performances in the png crate. The code base of this alternative decoder is very small for now (and not ready for beeing a crate yet) so don't hesitate to have a look if you're familiar with PNG decoding (this code is not very documented yet). |
@mpizenberg This is awesome, appreciate your hard work! Reopening this as tracking performance improvements since it both demonstrates possible improvements and contains a link to reference code. Switching the decoder (to |
It would be nice if someone could re-test the performance now that Speaking of Rust PNG implementations, there are also https://crates.io/crates/png_pong and https://crates.io/crates/imagine |
Hi, I'm trying to port an image processing algorithm to the web with wasm-bindgen. The first step is to read a png image. I used this crate for that and it worked so thanks for that! I've set up a minimal working example to use
png
in wasm. The issue I have is that the decoding takes roughly 0.1s on my machine in wasm for a 640x480 png while being orders of magnitude faster on native code (cf perf screenshot below).Any idea of what might be causing this issue?
The text was updated successfully, but these errors were encountered: