-
Notifications
You must be signed in to change notification settings - Fork 523
Conversation
Hi @Anderman, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
Did you benchmark this change? |
Yes, The Peeklong is 20% faster with this optimization. But the overal improvement will be small, with this simple change. |
if ({header.EqualIgnoreCaseBytes()}) | ||
{{ | ||
if ({header.TestBit()}) | ||
fixed (byte* ptr = &keyBytes[keyOffset]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the line above (and var pUB = ptr;
), are the rest of the changes in this method just formatting?
Yes that's correct. Now if I use CTRL K+D in the generated file the layout stays does not change anymore |
Ran these changes against our plaintext benchmark just to see. The numbers are close enough that I can't rule out variance for sure, but it's definitely possible this simple change made a difference. anderman/faster-unsafe:
dev:
|
Thanks! |
See issue