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

Parallel image encoding #478

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Parallel image encoding #478

wants to merge 4 commits into from

Conversation

fintelia
Copy link
Contributor

Adds a feature flag (rayon) that enables parallel encoding of PNGs. This drastically reduces the time taken to encode a single image. With target-cpu=native, my 6 core/12 thread CPU is able to exceed 1 billion pixels/second encoding speed on the QOI benchmark suite:

                                              Ratio             Encode
---------                                    -------     --------------------
Single-threaded                              27.861%     245 mps  0.829 GiB/s
Single-threaded (target-cpu=native)          27.861%     308 mps  1.042 GiB/s

Parallel                                     27.861%     917 mps  3.099 GiB/s
Parallel (target-cpu=native)                 27.861%    1084 mps  3.664 GiB/s

Depends on image-rs/fdeflate#23.

@Shnatsel
Copy link
Contributor

FWIW https://crates.io/crates/mtpng exists and can be used as inspiration/reference

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

Successfully merging this pull request may close these issues.

None yet

2 participants