Skip to content
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

JPEG-XL: decoding is extremely slow #179

Open
hillin opened this issue Mar 27, 2024 · 5 comments
Open

JPEG-XL: decoding is extremely slow #179

hillin opened this issue Mar 27, 2024 · 5 comments

Comments

@hillin
Copy link
Contributor

hillin commented Mar 27, 2024

I understand that zune-image uses jxl-oxide for JPEG-XL decoding and it's probably them are to blame, but since zune-image aims to be fast on all formats (hopefully, and eventually), I'm firing this issue here.

Again, here are some benchmarks:

zune encode jpeg        time:   [3.6447 ms 3.7083 ms 3.7759 ms]
zune encode jpeg-xl     time:   [4.4756 ms 4.5254 ms 4.5794 ms]
zune decode jpeg        time:   [936.37 µs 947.12 µs 958.96 µs]
zune decode jpeg-xl     time:   [54.592 ms 55.438 ms 56.382 ms]
@etemesi254
Copy link
Owner

Yea, I sadly didn't write the decoder, that is a format that scares me. :)

I wish i had infinite time to optimize them, but working on it

@hillin
Copy link
Contributor Author

hillin commented Apr 2, 2024

No worries, this is just for the backlog. Keep up the great work!

@Shnatsel
Copy link
Contributor

Shnatsel commented Apr 3, 2024

I've been doing some profiling on jxl-oxide and the author has been continuously working on improving performance, including based on my findings.

A 50x slowdown compared to JPEG is unexpected. I suggest you submit the file that causes such a large runtime to jxl-oxide issue tracker; it is possible that it is hitting an abnormally slow codepath that would be easy to optimize.

@etemesi254
Copy link
Owner

I also realized I was using a very ancient version, updated in 23c8bb1 so it might have lacked the optimizations above, so they should probably be rerun

@Shnatsel
Copy link
Contributor

It seems parallel decoding for jxl-oxide was not enabled. Enabling it should help performance: 72f16e4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants