mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-27 16:59:56 +01:00
serve_lines wrote replies with writeln!, which hands the writer every string, number and separator of the JSON value as a separate write. On an unbuffered TcpStream that is one system call per piece. Replies and the closing rejection now go through a 64 KiB BufWriter and are flushed once per line, so a small reply is one write and a large one is a few buffer-sized writes without a second whole copy in memory.