Make minor performance improvement to HTTP parser

redbean's message parser now takes 300 nanoseconds to parse a standard
request sent by chrome, whereas it previous took 600 nanoseconds.
This commit is contained in:
Justine Tunney 2021-03-28 18:00:29 -07:00
parent 3c19b6e352
commit 52565e7af3
6 changed files with 140 additions and 43 deletions

View file

@ -1,6 +1,7 @@
/* ANSI-C code produced by gperf version 3.1 */
/* Command-line: gperf gethttpheader.gperf */
/* Computed positions: -k'3-4,10' */
/* clang-format off */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@ -152,7 +153,7 @@ hash (register const char *str, register size_t len)
return hval;
}
const struct HttpHeaderSlot *
static const struct HttpHeaderSlot *
LookupHttpHeader (register const char *str, register size_t len)
{
static const struct HttpHeaderSlot wordlist[] =