mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 00:08:30 +00:00
Make HTTP message parsing a little faster
ParseHttpMessage() now does a better job avoiding malloc() calls and headers commonly sent by CloudFlare can now be consulted in constant time using our hard-coded perfect hash table. This increases /claim performance from 321k to 337k qps which is 5% faster.
This commit is contained in:
parent
726f04e8aa
commit
9f9b240f3d
5 changed files with 209 additions and 166 deletions
|
@ -140,7 +140,13 @@
|
|||
#define kHttpSecFetchMode 84
|
||||
#define kHttpSecFetchUser 85
|
||||
#define kHttpSecFetchDest 86
|
||||
#define kHttpHeadersMax 87
|
||||
#define kHttpCfRay 87
|
||||
#define kHttpCfVisitor 88
|
||||
#define kHttpCfConnectingIp 89
|
||||
#define kHttpCfIpcountry 90
|
||||
#define kHttpSecChUaPlatform 91
|
||||
#define kHttpCdnLoop 92
|
||||
#define kHttpHeadersMax 93
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
@ -155,7 +161,7 @@ struct HttpHeader {
|
|||
};
|
||||
|
||||
struct HttpHeaders {
|
||||
unsigned n;
|
||||
unsigned n, c;
|
||||
struct HttpHeader *p;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue