Skip to content

perf: buffer HTTP response writes to reduce TLS syscalls#51

Merged
tito merged 1 commit intoGreyhavenHQ:mainfrom
josezy:buffered-response-writes
Apr 22, 2026
Merged

perf: buffer HTTP response writes to reduce TLS syscalls#51
tito merged 1 commit intoGreyhavenHQ:mainfrom
josezy:buffered-response-writes

Conversation

@josezy
Copy link
Copy Markdown
Contributor

@josezy josezy commented Apr 21, 2026

resp.Write() emits many small writes (status line, headers, body chunks). On a TLS connection each write becomes a separate encryption and write() syscall. Wrapping with an 8 KB bufio.Writer coalesces these into fewer, larger TLS records.

Applied to both the HTTP handler and the MITM sniffer write paths.

resp.Write() emits many small writes (status line, headers, body
chunks). On a TLS connection each write becomes a separate encryption
and write() syscall. Wrapping with an 8 KB bufio.Writer coalesces
these into fewer, larger TLS records.

Applied to both the HTTP handler and the MITM sniffer write paths.
@tito tito merged commit 3529688 into GreyhavenHQ:main Apr 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants