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:
@@ -30,8 +30,11 @@ noinline size_t uint64toarray_radix10(uint64_t i, char a[hasatleast 21]) {
|
||||
size_t j;
|
||||
j = 0;
|
||||
do {
|
||||
a[j++] = i % 10 + '0';
|
||||
i /= 10;
|
||||
struct {
|
||||
uint64_t q, r;
|
||||
} x = {i / 10, i % 10};
|
||||
a[j++] = x.r + '0';
|
||||
i = x.q;
|
||||
} while (i > 0);
|
||||
a[j] = '\0';
|
||||
reverse(a, j);
|
||||
|
||||
Reference in New Issue
Block a user