Profiling kube-apiserver memory consumption and per-request allocation churn in isolation is critical: isolated microbenchmarks exercise individual helper functions without realistic control plane wiring, while full end-to-end cluster tests introduce external network latency, node-agent background jitter, and non-deterministic garbage collection timing.
BenchmarkRequestCost (cost_test.go) provides a deterministic in-process kube-apiserver and embedded etcd3 integration harness designed to evaluate both per-request allocation churn (allocated bytes and object allocations per operation across JSON, CBOR, Protobuf, and Table formats) and server lifecycle heap metrics (server setup allocated bytes, retained heap in-use, retained runtime in-use, heap released, and heap span fragmentat