no-mistakes(document): Document daemon paint benchmark
- commit
- c31f501c044e33a1d25a7fd9ec251effd1d7398b
- author
- brice · · 2026-07-09 14:52 UTC
- parent
- 0ac646d
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +4 -3
M AGENTS.md +1 -1
| @@ -12,7 +12,7 @@ make test | |||
| 12 | 12 | go test ./internal/usecase/daemon -race -run TestName | |
| 13 | 13 | make lint | |
| 14 | 14 | make mocks | |
| 15 | - | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc -bench=. -benchmem | |
| 15 | + | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -benchmem | |
| 16 | 16 | ``` | |
| 17 | 17 | ||
| 18 | 18 | - Format with **goimports**. | |
| @@ -12,7 +12,7 @@ make test | |||||
| 12 | go test ./internal/usecase/daemon -race -run TestName | 12 | go test ./internal/usecase/daemon -race -run TestName | ||
| 13 | make lint | 13 | make lint | ||
| 14 | make mocks | 14 | make mocks | ||
| 15 | - | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc -bench=. -benchmem | 15 | + | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -benchmem |
| 16 | ``` | 16 | ``` | ||
| 17 | 17 | ||||
| 18 | - Format with **goimports**. | 18 | - Format with **goimports**. | ||
M docs/performance.md +3 -2
| @@ -5,7 +5,7 @@ Enable daemon pprof explicitly with `VEV_PPROF_ADDR=127.0.0.1:6060 vev --daemon` | |||
| 5 | 5 | Run microbenchmarks with: | |
| 6 | 6 | ||
| 7 | 7 | ```sh | |
| 8 | - | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc -bench=. -benchmem | |
| 8 | + | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -benchmem | |
| 9 | 9 | ``` | |
| 10 | 10 | ||
| 11 | 11 | Demo flood workloads are scripted in `scripts/bench-workloads.sh` for `yes`, `seq`, and `cat` styles for raw/tmux runs. vev does not currently support `vev new <name> -- command`, so automated vev workload command overrides are intentionally not documented. Capture bytes/frame and syscalls/frame externally (for example with `strace -c` around the client/daemon) and allocations with `-benchmem`/pprof. | |
| @@ -24,12 +24,13 @@ strace -ff -c -o tmux-cat.strace tmux new-session -d -s perf-cat 'timeout 30s sh | |||
| 24 | 24 | ||
| 25 | 25 | Record host CPU, OS/kernel, terminal emulator, vev commit, tmux version, terminal size, workload duration, raw command lines, syscall summaries, bytes written per rendered frame, and heap profiles or allocation counts before comparing. | |
| 26 | 26 | ||
| 27 | - | Microbenchmarks executed locally for this review using `go test ./internal/adapters/ipc -run '^$' -bench=. -benchmem`: | |
| 27 | + | Microbenchmarks executed locally for this review using `go test ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -benchmem`: | |
| 28 | 28 | ||
| 29 | 29 | | benchmark | methodology | | |
| 30 | 30 | | --- | --- | | |
| 31 | 31 | | BenchmarkTransportSend | writes encoded frames to an in-memory discard `net.Conn`; allocations reported here are Send-side frame assembly costs. | | |
| 32 | 32 | | BenchmarkTransportRecvReuse | reads a pre-encoded frame from a looping in-memory reader; no `Send` call, goroutine, channel, or frame production work runs inside the measured loop, so allocations reported here are Recv-side costs only. | | |
| 33 | + | | BenchmarkPaintCachedSinglePaneDamage | writes a small damage update into one pane, paints through the daemon compose→diff→send path, and advances the output ACK each iteration so the measured loop does not hit the unacked-output bailout. | | |
| 33 | 34 | ||
| 34 | 35 | | workload | vev baseline | tmux baseline | notes | | |
| 35 | 36 | | --- | --- | --- | --- | | |
| @@ -5,7 +5,7 @@ Enable daemon pprof explicitly with `VEV_PPROF_ADDR=127.0.0.1:6060 vev --daemon` | |||||
| 5 | Run microbenchmarks with: | 5 | Run microbenchmarks with: | ||
| 6 | 6 | ||||
| 7 | ```sh | 7 | ```sh | ||
| 8 | - | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc -bench=. -benchmem | 8 | + | go test ./pkg/renderer ./pkg/vt ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -benchmem |
| 9 | ``` | 9 | ``` | ||
| 10 | 10 | ||||
| 11 | Demo flood workloads are scripted in `scripts/bench-workloads.sh` for `yes`, `seq`, and `cat` styles for raw/tmux runs. vev does not currently support `vev new <name> -- command`, so automated vev workload command overrides are intentionally not documented. Capture bytes/frame and syscalls/frame externally (for example with `strace -c` around the client/daemon) and allocations with `-benchmem`/pprof. | 11 | Demo flood workloads are scripted in `scripts/bench-workloads.sh` for `yes`, `seq`, and `cat` styles for raw/tmux runs. vev does not currently support `vev new <name> -- command`, so automated vev workload command overrides are intentionally not documented. Capture bytes/frame and syscalls/frame externally (for example with `strace -c` around the client/daemon) and allocations with `-benchmem`/pprof. | ||
| @@ -24,12 +24,13 @@ strace -ff -c -o tmux-cat.strace tmux new-session -d -s perf-cat 'timeout 30s sh | |||||
| 24 | 24 | ||||
| 25 | Record host CPU, OS/kernel, terminal emulator, vev commit, tmux version, terminal size, workload duration, raw command lines, syscall summaries, bytes written per rendered frame, and heap profiles or allocation counts before comparing. | 25 | Record host CPU, OS/kernel, terminal emulator, vev commit, tmux version, terminal size, workload duration, raw command lines, syscall summaries, bytes written per rendered frame, and heap profiles or allocation counts before comparing. | ||
| 26 | 26 | ||||
| 27 | - | Microbenchmarks executed locally for this review using `go test ./internal/adapters/ipc -run '^$' -bench=. -benchmem`: | 27 | + | Microbenchmarks executed locally for this review using `go test ./internal/adapters/ipc ./internal/usecase/daemon -run '^$' -bench=. -benchmem`: |
| 28 | 28 | ||||
| 29 | | benchmark | methodology | | 29 | | benchmark | methodology | | ||
| 30 | | --- | --- | | 30 | | --- | --- | | ||
| 31 | | BenchmarkTransportSend | writes encoded frames to an in-memory discard `net.Conn`; allocations reported here are Send-side frame assembly costs. | | 31 | | BenchmarkTransportSend | writes encoded frames to an in-memory discard `net.Conn`; allocations reported here are Send-side frame assembly costs. | | ||
| 32 | | BenchmarkTransportRecvReuse | reads a pre-encoded frame from a looping in-memory reader; no `Send` call, goroutine, channel, or frame production work runs inside the measured loop, so allocations reported here are Recv-side costs only. | | 32 | | BenchmarkTransportRecvReuse | reads a pre-encoded frame from a looping in-memory reader; no `Send` call, goroutine, channel, or frame production work runs inside the measured loop, so allocations reported here are Recv-side costs only. | | ||
| 33 | + | | BenchmarkPaintCachedSinglePaneDamage | writes a small damage update into one pane, paints through the daemon compose→diff→send path, and advances the output ACK each iteration so the measured loop does not hit the unacked-output bailout. | | |||
| 33 | 34 | ||||
| 34 | | workload | vev baseline | tmux baseline | notes | | 35 | | workload | vev baseline | tmux baseline | notes | | ||
| 35 | | --- | --- | --- | --- | | 36 | | --- | --- | --- | --- | | ||