veluca93 / fpnge

Demo of a fast PNG encoder.
Apache License 2.0
88 stars 8 forks source link

Encode speed optimizations (3) #10

Closed animetosho closed 2 years ago

animetosho commented 2 years ago

Last batch of optimizations. These shouldn't affect the output in any way.

The largest change comes from the observation that most symbols will be <= 8 bits, since we expect compression to work, so a shortcut can be taken in this common case.

Comparison on a 12700K:

Old code - image 1
   311.271 MP/s
    10.787 bits/pixel
Old code - image 2
   394.295 MP/s
    16.240 bits/pixel

New code - image 1
   392.560 MP/s
    10.787 bits/pixel
New code - image 2
   423.004 MP/s
    16.240 bits/pixel

CLA response: I release these changes to the public domain subject to the CC0 license (https://creativecommons.org/publicdomain/zero/1.0/).

google-cla[bot] commented 2 years ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

veluca93 commented 2 years ago

Would you mind removing all the merge commits and rebasing everything else on top of main?