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

zune-jpeg 2x slower than image crate on my M1 MacBook #132

Closed
emilk opened this issue Jun 9, 2023 · 4 comments
Closed

zune-jpeg 2x slower than image crate on my M1 MacBook #132

emilk opened this issue Jun 9, 2023 · 4 comments

Comments

@emilk
Copy link

emilk commented Jun 9, 2023

I am really intrigued by zune-image based on its compilation time and boasted speed, but my first impression is that it is much slower than the image crate.

I am decoding 1440 × 1920 RGB JPEGs. image takes around 17 ms to decode a 1440 × 1920 RGB JPEG, while zune-jpeg takes around 33ms. I am NOT using the jpeg_rayon feature of image.

Here is one of the images that decodes slowly:

53

(the image comes from saving frames of videos from https://github.com/google-research-datasets/Objectron)

@etemesi254
Copy link
Owner

hi it's because our idct is not vectorized but jpeg decoder contains one, there was some effort to address that and there was a branch which achieved that , I was to manually merge it but time became an issue, and I don't have the hardware to test it

@etemesi254
Copy link
Owner

Merged neon optimized idct to dev branch which should improve decode times considerably for Arm Neon chips.

I can't really test by how much, but would love if you could report speeds on your side

@emilk
Copy link
Author

emilk commented Jun 11, 2023

I'm sorry, my original number were bad somehow. I've now done better measurements and I've found this:

  • image: 15.6 ms per jpeg
  • zune-jpeg 0.3.17: 10.3 ms per jpeg
  • zune-jpeg dev branch: 8.2 ms per jpeg

I also measured in Firefox when compiling to WASM:

  • image: 35 ms per jpeg
  • zune-jpeg 0.3.17: 29 ms per jpeg
  • zune-jpeg dev branch: 29 ms per jpeg

So: seems like I'm switching to zune-jpeg 🤘😃

@emilk emilk closed this as completed Jun 11, 2023
@etemesi254
Copy link
Owner

good to hear that

WASM speeds can be improved with using wasm intrinsics, If I happen to have time I may implement it but no promises there :)

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

2 participants