The story’s score and claims

Comments on No. 14 of 141 · peng.fyi · edition of Friday 4 December 2026

Set GOMAXPROCS of small Go program to avoid overhead when run it on large host

Summary

A benchmark on a 64-core host from Peng Zhang shows that small Go programs carry overhead sized by GOMAXPROCS, which defaults to all visible CPUs when no cgroup quota applies. With 100 copies of a polling program, GOMAXPROCS=2 instead of 64 cut memory from 684 to 503 MiB, threads from 2,240 to 476, and CPU from 0.98 to 0.54 cores. A Rust version on tokio's current-thread runtime used 16 MiB. These are single-host, single-workload results, and several runtime explanations were not independently verified.

Comments

Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules