Skip to content

Use Span in GetHTreeGroupForPos to avoid allocations - #1793

Merged
brianpopow merged 1 commit into
masterfrom
bp/webpavoidallocations
Oct 26, 2021
Merged

brianpopow merged 1 commit into
masterfrom
bp/webpavoidallocations

Conversation

@brianpopow

@brianpopow brianpopow commented Oct 26, 2021 •

Copy link
Copy Markdown
Collaborator

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

codecov Bot commented Oct 26, 2021

Copy link
Copy Markdown

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.

@antonfirsov antonfirsov left a comment

Copy link
Copy Markdown
Member

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