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

Drastically improve encoding performance #364

Merged
merged 4 commits into from
Dec 25, 2022

Conversation

fintelia
Copy link
Contributor

@fintelia fintelia commented Nov 22, 2022

The goal of this PR is to achieve faster-than-QOI encoding performance. It adds a custom zlib implementation that leverages assumptions about the patterns in PNG data to get reasonable compression ratios at phenomenal speeds. Takes inspiration from fpng and fpnge.

Builds on #363 and improves performance by several times...

Directory                                     Ratio             Encode                    Decode
---------                                    -------     --------------------      --------------------
Total                                        28.282%     294 mps   0.99 GiB/s       53 mps   0.18 GiB/s

qoibench on the same machine...

# Grand total for qoi_benchmark_suite/images/
        decode ms   encode ms   decode mpps   encode mpps   size kb    rate
libpng:       5.3        69.6         87.49          6.67       398   24.2%
stbi:         4.6        39.7        100.63         11.70       561   34.2%
qoi:          1.5         2.0        308.68        227.88       463   28.2%

@fintelia fintelia marked this pull request as ready for review December 23, 2022 09:08
@Shnatsel
Copy link
Contributor

#370 should come in handy for testing this.

Copy link
Contributor

@Shnatsel Shnatsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues on the roundtrip fuzzer after 10 million executions

@fintelia
Copy link
Contributor Author

fintelia commented Dec 24, 2022

The core compression logic has also been fuzzed directly here.

@fintelia fintelia merged commit 80f674f into image-rs:master Dec 25, 2022
@fintelia fintelia deleted the fdeflate2 branch December 25, 2022 20:07
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