
What the Go scheduler does when your goroutine blocks
A blocking syscall costs an OS thread. A blocking network read costs nothing. Measured with 200 goroutines, GOMAXPROCS=2 and a thread count.
A Go publication by Nolan Keir
Deep dives into the Go runtime, concurrency, performance, and the trade-offs behind clean abstractions.

A blocking syscall costs an OS thread. A blocking network read costs nothing. Measured with 200 goroutines, GOMAXPROCS=2 and a thread count.
The compiler eliminated every check in four spellings of the same sum. The folklore hint changed nothing, and the one surviving check cost less than the harness's own error.
The compiler prints what every construct costs. A make and a map index cost 2 each; a call costs 59; defer and go are not priced at all — they disqualify.
`-gcflags=-m` printed "escapes to heap" for the constructor and "does not escape" for half the places that call it. The package boundary had nothing to do with it.
Same program, two sample types. alloc_space blames my function for 100% of it; inuse_space blames the runtime's scavenger, and both are correct.
Go 1.27's size-specialised allocation is worth up to 46% on the pointer-containing path, not the 30% announced — and from 96 bytes up it is worth nothing.
A gctrace line carries eleven numbers. Two are stop-the-world, one has a third of the GC subtracted out of it, and the biggest one is not a pause at all.
Series4 parts
Starts with: What the Go scheduler does when your goroutine blocks
Series1 part
Starts with: The 30% is 46%, and it stops dead at 80 bytes