Go Runtime Internals
Form a measurement hypothesis about allocation, retention or scheduling. Runtime details are compiler/version dependent; record the actual build.
1 / 5
Form a measurement hypothesis about allocation, retention or scheduling. Runtime details are compiler/version dependent; record the actual build.
A cached 20-byte slice can retain a 4 MiB input buffer. Compare aliasing with copying those 20 bytes into owned storage. Measure allocated bytes and retained heap separately under equal cache population.
Correctness must survive every sync.Pool Get missing. After Put, callers must not keep using scratch-buffer aliases. The pool is not durable storage or a promise of which item comes back.
Stack growth may explain deeper-call latency; profiles must establish the cost. More goroutines may increase runnable contention without adding CPU capacity. GOMEMLIMIT is a soft runtime limit, not a hard RSS ceiling.
Choose one retention or pool experiment from the lesson. Record workload, hypothesis, profile and evidence that would reject the change. A lower allocation count alone does not prove a latency improvement.