Traneptora / jxlatte

Java JPEG XL decoder
MIT License
44 stars 5 forks source link

Decoding jxl is much slower than equivalent png #24

Closed terranprog closed 7 months ago

terranprog commented 1 year ago

I am finding decoding jxl images using jxlatte takes around 10 times longer than decoding the same image saved as png.

My process is as follows:

  1. Start with png image
  2. Convert png to jxl using the reference jxl encoder libjxl. Use lossless compression.
  3. Read png image using ImageIO
  4. Read jxl using jxlatte with default settings

I did 3 runs of each (with JVM warmup) Times are in milliseconds.

JXL Time to process 20 jxl files is 4004 Time to process 20 jxl files is 3919 Time to process 20 jxl files is 3882

PNG Time to process 20 png files is 362 Time to process 20 png files is 398 Time to process 20 png files is 379

I have attached a sample jxl file

Sample.zip

terranprog commented 1 year ago

I have raised a pull request with some simple code changes that improve performance.

https://github.com/Traneptora/jxlatte/pull/25

Traneptora commented 1 year ago

jxlatte isn't optimized, for starters, but also do note that I've been focusing on compliance and completeness recently and fixing bugs rather than optimizing.

terranprog commented 1 year ago

OK thanks. That's good to hear. Being new to jpegxl format, I wasn't sure if this was an inherent trade-off with the format.

Traneptora commented 1 year ago

It is, since PNG is much less sophisticated, but it's nowhere near as extreme as you'd see with jxlatte vs standard PNG.