-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Add custom request header decoder API to Kestrel #23233
Conversation
src/Servers/Kestrel/Core/src/Internal/Infrastructure/HttpUtilities.cs
Outdated
Show resolved
Hide resolved
src/Servers/Kestrel/Core/ref/Microsoft.AspNetCore.Server.Kestrel.Core.netcoreapp.cs
Show resolved
Hide resolved
Http1ConnectionBenchmark Microbenchmark ResultsBefore (release/5.0-preview7)default (UTF-8) encoding
latin1 (ISO-8859-1) encoding
After (halter73/17400)default (UTF-8) encoding
latin1 (ISO-8859-1) encoding (
|
Method | Mean | Error | StdDev | Op/s | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|
LiveAspNet | 1.172 us | 0.0217 us | 0.0203 us | 853,229.7 | 0.0210 | - | - | 880 B |
Alternative default (UTF-8) encoding (RequestHeaderEncodingSelector = _ => null
)
Method | Mean | Error | StdDev | Op/s | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|
LiveAspNet | 1.146 us | 0.0166 us | 0.0155 us | 872,465.7 | 0.0229 | - | - | 880 B |
Alternative defaultish (UTF-8) encoding (RequestHeaderEncodingSelector = _ => Encoding.UTF8
)
Method | Mean | Error | StdDev | Op/s | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|---|
LiveAspNet | 1.310 us | 0.0173 us | 0.0153 us | 763,159.7 | 0.0229 | - | - | 880 B |
Given that we're trying to not regress perf rather than improve it with this PR, this all looks reasonable to me.
I made sure to set DisableStringReuse = true
and hard-coded the "runtimeFrameworkVersion" to 5.0.0-preview.8.20323.9 for all benchmark runs. See #23000 (comment)
@Pilchie Can you merge this? |
Can you run a CPU profile to see if there's anything that stands out? |
Also can you run the PR benchmark? This is basically in the hot path. |
I don't have time for this today, and I still want this in preview7. It wouldn't be that useful yet anyway, since in the default case, we do 1 extra ReferenceEquals() comparison per request header and follow the old request decoding path. I don't need a CPU profile to tell me that. |
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID 'cf5b7aeeed484d849f9228c166698b36'. This could take up to 30 minutes... |
Baseline
PR
|
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.
Watch the benchmarks and lets make sure we profile this
I'm also talking to @sebastienros about the benchmark server issue. I agree with him that we should move over to the new driver so we can use the same servers as everything else. We just need to budget time to make the changes. |
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID '1357ac5cf4f14d2c80c16f4120a48094'. This could take up to 30 minutes... |
Baseline
PR
|
Partially Addresses #17400