-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Make header parsing "safe" #20562
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
Make header parsing "safe" #20562
Conversation
@aspnet-hello benchmark |
How did you get Ben's password hacker person? |
Starting 'Default' pipelined plaintext benchmark with session ID '0418e4f483af43ab88ed6c514379f11b'. This could take up to 30 minutes... |
Baseline
PR
|
Hmm... I think it can go faster... |
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID 'e14a4ddadca14a32a69d2c229c35de81'. 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.
Nits
Meh skipping bounds check for one space doesn't make a great difference and doesn't look very pretty; so reverted |
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID 'd03e9c0016c24d1dbe7c5d2298b203f8'. This could take up to 30 minutes... |
Baseline
PR
|
@blowdart you'll be pleased to know normal service has been resumed 😉
|
6f6f452
to
515fb08
Compare
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID 'fdcf5ba5ae7b4edabd81a28624c093b3'. This could take up to 30 minutes... |
Baseline
PR
|
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID 'ab1c5b8a298040fbacbbd70f1a2c2c90'. This could take up to 30 minutes... |
Baseline
PR
|
@aspnet-hello benchmark |
Starting 'Default' pipelined plaintext benchmark with session ID 'e38f2758627943d1824c07f26bba7134'. This could take up to 30 minutes... |
I've fetched these changes and run them against the microbenchmarks from #20518 Before:
After:
I've also run it against the JsonPlatform benchmark and it gives something around +3-5k RPS improvement for JSON. @benaadams thank you! |
Impressive! |
Safe and faster |
917e315
to
02debfc
Compare
Squashed to single commit and rebased |
Errors from running out of space
And publish error which might be the same
|
Ubuntu |
@@ -236,159 +234,229 @@ public unsafe bool ParseHeaders(TRequestHandler handler, ref SequenceReader<byte | |||
// in the span to contain a header. | |||
if (readAhead == 0) | |||
{ | |||
length = span.IndexOf(ByteLF) + 1; | |||
if (length > 0) | |||
length = span.IndexOfAny(ByteCR, ByteLF); |
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.
👍
5e58983
to
0ba3a52
Compare
Rebased to see if ci is alive |
It's alive 😎 |
Thanks @benaadams! |
@anurse looks like release notes are done by milestones; want to stick one on this? |
To @blowdart with ❤
Contributes to #4720
/cc @davidfowl
Results #20562 (comment)