Skip to content

Minor PNG Encoding Optimization for DeflaterEngine and WuQuantizer #2023

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

Merged
merged 4 commits into from
Mar 4, 2022

Conversation

ratok-mk
Copy link
Contributor

@ratok-mk ratok-mk commented Feb 21, 2022

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

I investigated some possible code optimizations and found minor issues with unnecessary operations in:

  • DeflaterEngine
  • WuQuantizer

It is connected to the following discussion

A comparison with BenchmarkDotNet showed ~3% improvement for a 2560 x 1920 image 16 Bit Grayscale Image.
Also used existing test 'ImageSharp Png' for .NET 5.0:
Before (mean): 36.07ms
Optimized (mean): 35.62 ms

@ratok-mk ratok-mk changed the title Minor Optimization for DeflaterEngine and WuQuantizer Minor PNG Encoding Optimization for DeflaterEngine and WuQuantizer Feb 21, 2022
ratok-mk and others added 2 commits February 22, 2022 17:21
Co-authored-by: Günther Foidl <gue@korporal.at>
Fixed CodeStyle warnings
Copy link
Member

@JimBobSquarePants JimBobSquarePants left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks! 👍

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

Successfully merging this pull request may close these issues.

4 participants