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

Use Span in GetHTreeGroupForPos to avoid allocations #1793

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

brianpopow
Copy link
Collaborator

@brianpopow brianpopow commented Oct 26, 2021

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

This PR will remove an unnecessary call to ToArray() and use Span instead.

Before:
Before

After:
After

Example is for earth_lossless.webp

@codecov
Copy link

codecov bot commented Oct 26, 2021

Codecov Report

Merging #1793 (e168ae6) into master (d3f3eec) will increase coverage by 0.00%.
The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1793   +/-   ##
=======================================
  Coverage   87.03%   87.04%           
=======================================
  Files         936      936           
  Lines       47649    47649           
  Branches     6015     6015           
=======================================
+ Hits        41472    41474    +2     
+ Misses       5182     5181    -1     
+ Partials      995      994    -1     
Flag Coverage Δ
unittests 87.04% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...Sharp/Formats/Webp/Lossless/WebpLosslessDecoder.cs 94.67% <66.66%> (ø)
...ageSharp/Formats/Webp/Lossless/PredictorEncoder.cs 89.01% <0.00%> (+0.19%) ⬆️
...ImageSharp/Formats/Webp/Lossless/Vp8LBitEntropy.cs 100.00% <0.00%> (+1.19%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3f3eec...e168ae6. Read the comment docs.

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

LGTM, seems trivial.

@brianpopow brianpopow merged commit 2add3e1 into master Oct 26, 2021
@brianpopow brianpopow deleted the bp/webpavoidallocations branch October 26, 2021 15:40
@JimBobSquarePants JimBobSquarePants linked an issue Oct 27, 2021 that may be closed by this pull request
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.

WebP - Improve performance
2 participants