Skip to content

Conversation

@Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented Feb 20, 2020

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 matches 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

Optimization to the Block8x8 constructor, as discussed with @JimBobSquarePants.

Before (Release x64):

SixLabors.ImageSharp.Formats.Jpeg.Components.Block8x8..ctor(System.Span`1<Int16>)
    L0000: sub rsp, 0x28
    L0004: mov r8, [rdx]
    L0007: mov edx, [rdx+0x8]
    L000a: shl rdx, 1
    L000d: cmp rdx, 0x7fffffff
    L0014: ja L002a
    L0016: mov rdx, r8
    L0019: mov r8d, 0x80
    L001f: call 0x7ffa28883850
    L0024: nop
    L0025: add rsp, 0x28
    L0029: ret
    L002a: call 0x7ffa289aed50
    L002f: int3

After:

SixLabors.ImageSharp.Formats.Jpeg.Components.Block8x8..ctor(System.Span`1<Int16>)
    L0000: mov rdx, [rdx]
    L0003: mov r8d, 0x80
    L0009: call 0x7ffa28883850
    L000e: nop
    L000f: ret

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.

Relaunched the CI, we can merge as soon as all checks are passing.

@codecov
Copy link

codecov bot commented Feb 21, 2020

Codecov Report

Merging #1117 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1117   +/-   ##
=======================================
  Coverage   82.10%   82.10%           
=======================================
  Files         680      680           
  Lines       28677    28677           
  Branches     3245     3245           
=======================================
  Hits        23544    23544           
  Misses       4457     4457           
  Partials      676      676           
Flag Coverage Δ
#unittests 82.10% <100.00%> (ø) ⬆️

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 07c16a5...fb8b82d. Read the comment docs.

@antonfirsov antonfirsov merged commit 20f4bfb into master Feb 21, 2020
@antonfirsov antonfirsov deleted the optimization/branchless-block8x8-constructor branch February 21, 2020 00:45
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.

3 participants