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

Backport 0.14.x: is_complete_fast #3765

Merged
merged 1 commit into from
Oct 15, 2024
Merged

Commits on Oct 15, 2024

  1. perf(http1): improve parsing of sequentially partial messages

    If request headers are received in incremental partial chunks, hyper
    would restart parsing each time. This is because the HTTP/1 parser is
    stateless, since the most common case is a full message and stateless
    parses faster.
    
    However, if continuing to receive more partial chunks of the request,
    each subsequent full parse is slower and slower. Since partial parses is
    less common, we can store a little bit of state to improve performance
    in general.
    
    Now, if a partial request is received, hyper will check for the end of
    the message quickly, and if not found, simply save the length to allow
    the next partial chunk to start its search from there. Only once the end
    is found will a fill parse happen.
    
    Reported-by: Datong Sun <datong.sun@konghq.com>
    seanmonstar committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    e3aab95 View commit details
    Browse the repository at this point in the history