Closed FrankenApps closed 3 years ago
Yeah, it's probably wrong - I am skeptical of the benchmark I made for libpng-sys, too. I'd rather fix it than remove it, though. If you have any ideas PRs are welcome, just don't include any I/O in the benchmark.
Hi, I was looking for a fast way to encode .pngs in Rust, so I stumbled over your performance comparison. Looking at the table it seems like
libpng-sys
just totally rocks for sRGBA images. For examplesRGBA 4096x4096
took 0.039266 ms, which if true would be totally insane.So I tried it. Turns out it is as fast as measured, but only because it does exactly nothing. Here is my test script, heavily inspired by your benchmark:
I had to use
const-cstr
in my Cargo.toml:As you can see by running the code, no file was ever created, which I suspect is also true for encoding in memory. I have not tested, if sRGB 4096x4096 works, but at 3.7263 ms that would still be insanely fast for .png encoding (I tried quite a bunch of stuff already ;-) ).
So it seems to me, that if have not missed anything
libpng-sys
should better be removed from the comparison, because it does not seem to work, or needs a fix to run properly...