mirror of
https://github.com/tailscale/tailscale.git
synced 2026-06-06 21:01:11 +08:00
Use bufio.Writer.AvailableBuffer to write the 32-byte public key directly into bufio's internal buffer as a single append+Write, avoiding 32 separate WriteByte calls. Fall back to the existing byte-at-a-time path when the buffer has insufficient space. ``` name old ns/op new ns/op speedup NodeWriteRawWithoutAllocating-8 121 12.5 ~9.7x (0 allocs/op in both) ``` Add BenchmarkNodeWriteRawWithoutAllocating and expand TestNodeWriteRawWithoutAllocating to cover both fast (AvailableBuffer) and slow (WriteByte fallback) paths with correctness and allocation checks. Updates tailscale/corp#38509 Signed-off-by: Mike O'Driscoll <mikeo@tailscale.com> |
||
|---|---|---|
| .. | ||
| chal.go | ||
| control_test.go | ||
| control.go | ||
| derp_test.go | ||
| derp.go | ||
| disco_test.go | ||
| disco.go | ||
| doc.go | ||
| hardware_attestation.go | ||
| machine_test.go | ||
| machine.go | ||
| nl_test.go | ||
| nl.go | ||
| node_test.go | ||
| node.go | ||
| util_test.go | ||
| util.go | ||