On Friday, 27 May 2022 at 20:51:14 UTC, zoujiaqing wrote:
On Thursday, 26 May 2022 at 07:49:23 UTC, tchaloupka wrote:

I fixed the performance bug the first time. (The default HTTP 1.1 connection is keep-alive)

Archttp version 1.0.2 has been released, and retesting has yielded significant performance improvements.

-- zoujiaqing

Hi, thanks for the PR. I've rerun the tests for `archttp` and it is indeed much better.
Now on par with `vibe-d`

Some more notes for a better performance (it's the same with `vibe-d` too).
See what syscalls are called during the request processing:

```
[pid 1453] read(10, "GET / HTTP/1.1\r\nHost: 192.168.12"..., 1024) = 117 [pid 1453] write(10, "HTTP/1.1 200 OK\r\nDate: Sat, 28 M"..., 173) = 173
[pid  1453] write(10, "Hello, World!", 13) = 13
```

It means two separate syscalls for header and body. This alone have huge impact on the performance and if it can be avoided, it would be much better.

Also read/write while working with a socket too, are a bit slower than recv/send.

Reply via email to