-
Notifications
You must be signed in to change notification settings - Fork 244
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
Platform level: Reduce interface dispatch and trys in main loop #412
Conversation
6,460,818 RPS Getting close to the 7M top contender |
Added PR to change parsing to pass |
var examined = buffer.End; | ||
if (!buffer.IsEmpty) | ||
{ | ||
ParseHttpRequest(in buffer, out consumed, out examined); |
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.
Why are you passing in here explicitly?
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.
No reason; will change :)
{ | ||
consumed = buffer.Start; | ||
examined = buffer.End; | ||
|
||
if (_state == State.StartLine) | ||
var parsedStartLine = _state == State.StartLine; |
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.
parsingStartLine?
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.
Changed
var examined = buffer.End; | ||
if (!buffer.IsEmpty) | ||
{ | ||
ParseHttpRequest(in buffer, out consumed, out examined); |
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.
Why are you specifying in.
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.
LGTM, I'm confused by in
{ | ||
consumed = buffer.Start; | ||
examined = buffer.End; | ||
|
||
if (_state == State.StartLine) | ||
var parsingStartLine = _state == State.StartLine; | ||
if (parsingStartLine) | ||
{ | ||
if (Parser.ParseRequestLine(this, buffer, out consumed, out examined)) |
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.
Would it make sense to allow passing buffer by-in?
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.
Yes, we just changed this in Kestrel.
Now go fix SqlClient 😁 |
@ErikEJ yeah, and we are actively working on making it faster too, but FYI SqlClient is already faster than the implementations for NodeJs and Java that we tested, measured on Windows (SNI) and Linux (managed). The SqlClient team has already made great improvements that will be visible with the next release (faster on Linux, faster azure encrypted connections, reliability, ...), and it will also benefit 2.0 apps. |
/cc @davidfowl @KrzysztofCwalina @sebastienros