Skip to content

SkipLocalsInit on methods with stackalloc #32567

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

Merged
5 commits merged into from
May 12, 2021
Merged

SkipLocalsInit on methods with stackalloc #32567

5 commits merged into from
May 12, 2021

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented May 11, 2021

Like #26598 but explicitly adds the attribute on only some methods. The benefit is smaller but less likely to cause bugs.

@JamesNK JamesNK requested a review from a team May 11, 2021 04:37
@JamesNK JamesNK requested review from davidfowl and removed request for a team May 11, 2021 04:38
@JamesNK JamesNK changed the title SkipLocalsInit on Kestrel methods with stackalloc SkipLocalsInit on methods with stackalloc May 11, 2021
@@ -27,6 +28,7 @@ public DfaMatcher(ILogger<DfaMatcher> logger, EndpointSelector selector, DfaStat
_isDefaultEndpointSelector = selector is DefaultEndpointSelector;
}

[SkipLocalsInit]
Copy link
Member

Choose a reason for hiding this comment

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

FWIW, you'll get better performance if you change line 48 to use a const value rather than a variable value. If it's impractical to do so, no change needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I noticed that. I don't want to mess with it in this PR: #32569 😄

@ghost
Copy link

ghost commented May 12, 2021

Hello @JamesNK!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit 350cf6b into main May 12, 2021
@ghost ghost deleted the jamesnk/skiplocalsinit-v2 branch May 12, 2021 23:27
@davidfowl davidfowl added this to the 6.0-preview5 milestone May 17, 2021
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants