Skip to content

Conversation

@benaadams
Copy link
Member

@benaadams benaadams commented May 20, 2024

Changes

  • Take the .Topics array to a local array rather than operating through the property so the Jit can confirm it's .Length cannot change per iteration and eliminate the bounds check.

Before the asm contains the RNGCHKFAIL exception

G_M000_IG09:                ;; offset=0x00D7
       xor      rdx, rdx
       xor      r8d, r8d
       jmp      G_M000_IG05
 
G_M000_IG10:                ;; offset=0x00E1
       call     CORINFO_HELP_RNGCHKFAIL
       int3     
 
; Total bytes of code 231

After it doesn't (and asm is slightly smaller)

G_M000_IG09:                ;; offset=0x00CF
       xor      rdx, rdx
       xor      r8d, r8d
       jmp      G_M000_IG05
 
; Total bytes of code 217

Types of changes

What types of changes does your code introduce?

  • Optimization

Testing

Requires testing

  • No

@LukaszRozmej LukaszRozmej merged commit d781283 into master May 20, 2024
@LukaszRozmej LukaszRozmej deleted the bloom branch May 20, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants