Go's Pure-Go DNS Resolver and the Hosts File Fast Path
The net package picks a lookup order from nsswitch.conf, checks /etc/hosts with a five-second cache, then queries the pure-Go DNS client, which reads resolv.conf, walks the search …
The net package picks a lookup order from nsswitch.conf, checks /etc/hosts with a five-second cache, then queries the pure-Go DNS client, which reads resolv.conf, walks the search …
regexp.Compile builds a syntax program and then picks one of three engines: one-pass for anchored unambiguous patterns, a bit-state backtracker for small inputs, and a parallel NFA …
Each P owns a 256-entry run queue plus a global overflow queue; idle Ms spin, steal half a victim’s queue at a time, and only park after the delicate dance that avoids losing work.
A Go slice is a pointer, a length and a capacity over a shared backing array: append doubles under 256 elements and grows 1.25x above it, and every growth memmoves the old contents …
The sweeper reclaims dead spans lazily with a generation counter, spread across the mutator and a background goroutine, and a separate scavenger returns the freed pages to the …