Skip to content
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

Use SearchValues throughout dotnet/aspnetcore (part 2) #54804

Merged
merged 3 commits into from
Apr 2, 2024

Conversation

ladeak
Copy link
Contributor

@ladeak ladeak commented Mar 27, 2024

Use SearchValues throughout dotnet/aspnetcore

Using SearchValues in cookie header parser to find the end of the cookie value.

Description

For the performance comparison, I used the existing RequestCookieCollectionBenchmarks:

BenchmarkDotNet=v0.13.0, OS=Windows 10.0.22631
12th Gen Intel Core i7-1255U, 1 CPU, 12 logical and 10 physical cores
.NET SDK=9.0.100-preview.3.24161.2
  [Host]     : .NET 9.0.0 (9.0.24.17301), X64 RyuJIT
  Job-XWCXZR : .NET 9.0.0 (9.0.24.16003), X64 RyuJIT

Server=True  Toolchain=.NET Core 9.0  InvocationCount=1
RunStrategy=Throughput  UnrollFactor=1

Before:

Method Mean Error StdDev Op/s Gen 0 Gen 1 Gen 2 Allocated
Parse_TypicalCookie 13.11 us 1.670 us 4.845 us 76,275.9 - - - 1 KB

After:

Method Mean Error StdDev Op/s Gen 0 Gen 1 Gen 2 Allocated
Parse_TypicalCookie 6.914 us 0.2298 us 0.6444 us 144,628.1 - - - 952 B

If the approach is agreed, I would continue to extend this PR covering further tasks mentioned in the linked issue. At that point I will mark the PR as draft until those are done. Although I can do independent PRs as well, please indicate the preference.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Mar 27, 2024
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Mar 27, 2024
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Nice

Co-authored-by: Günther Foidl <gue@korporal.at>
src/Http/Shared/CookieHeaderParserShared.cs Outdated Show resolved Hide resolved
Co-authored-by: Andrew Casey <amcasey@users.noreply.github.com>
@ladeak ladeak requested a review from amcasey March 30, 2024 17:55
Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

Thanks for the update! The CI failure is unrelated, so I've kicked off a re-run.

@amcasey
Copy link
Member

amcasey commented Apr 1, 2024

Anything else before I merge, @gfoidl?

@amcasey amcasey merged commit 7f4a3ef into dotnet:main Apr 2, 2024
26 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-preview4 milestone Apr 2, 2024
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 community-contribution Indicates that the PR has been added by a community member Perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants