lpereira / lwan

Experimental, scalable, high performance HTTP server
https://lwan.ws
GNU General Public License v2.0
5.92k stars 549 forks source link

is this the fastest parser? https://github.com/h2o/picohttpparser #314

Closed superdolt closed 3 years ago

superdolt commented 3 years ago

is this the fastest parser? https://github.com/h2o/picohttpparser if so, possible to add into lwan?

lpereira commented 3 years ago

Part of the motivation for Lwan is for myself to write everything that matters for a HTTP server, including the request parser. I don't want to use a 3rd party library, however better it might be.

If you'd like to add the same kinds of optimizations as picohttpparser (which include, but does not limit to) using SIMD instructions to the parser in Lwan, and if that is as easy to maintain as what's currently there and the performance gain is worth the maintenance headache, I'll gladly accept the PR. I failed to make these optimizations myself, but maybe a fresh look with another pair of eyes can yield a better result.

There are other things that will limit the parser performance and that I want to fix. For instance, for pipelined requests, a memmove() is necessary currently; that is consistently shown in profiles. For all other requests, there are some calls to memrmem() inside the finalizer that are shown in profiles that could be removed if someone thought of a better way to write that function; that is used to find the request-end-terminator (CRLFCRLF), and that information is discarded -- that might be useful later on, so another thing to keep in mind.

On Sun, Sep 12, 2021 at 1:35 PM superdolt @.***> wrote:

is this the fastest parser? https://github.com/h2o/picohttpparser if so, possible to add into lwan?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lpereira/lwan/issues/314, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADVGKX7ZL26ZA2OQO6QZLUBSUC3ANCNFSM5D4DOTCA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Leandro

superdolt commented 3 years ago

ok thx. appreciate your work.

what u hv done is difficult for layman beginner c programmer like me to even comprehend but really hope it's the fastest there is.