-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
perf: optimize header list size calculations #750
perf: optimize header list size calculations #750
Conversation
be897a2
to
d5b89a2
Compare
Accidentally targeted it at 0.3, though I think this is enough of a perf improvement to justify a backport. We can just forwardport this to 0.4 after I guess? |
dff5782
to
eb64392
Compare
This speeds up loading blocks in cases where we have many headers already.
eb64392
to
0e7ca68
Compare
@@ -892,6 +901,8 @@ impl HeaderBlock { | |||
|
|||
headers_size += decoded_header_size(name.as_str().len(), value.len()); | |||
if headers_size < max_header_list_size { | |||
self.field_size += | |||
decoded_header_size(name.as_str().len(), value.len()); |
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.
Should we check that decoded_header_size
won't exceed max_header_list_sized
?
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.
that is covered under other checks elsewhere
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.
Nvm, that's exactly what this does
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.
Yeah I don't know why I said that lol, it's literally checked right here.
This speeds up loading blocks in cases where we have many headers already.
This speeds up loading blocks in cases where we have many headers already.
This speeds up loading blocks in cases where we have many headers already.