mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-06 03:08:31 +00:00
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:
parent
3c19b6e352
commit
52565e7af3
6 changed files with 140 additions and 43 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue