Go Runtime Internals

Form a measurement hypothesis about allocation, retention or scheduling. Runtime details are compiler/version dependent; record the actual build.

1 / 5

Retention can hide behind zero allocations

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.

2 / 5

Pool ownership

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.

3 / 5

Test runtime hypotheses

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.

4 / 5

Independent experiment

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.

5 / 5
←/→ or click edges to navigate · ? help · N notes · F fullscreen