Skip to content
Opensource internals
  • Posts

Go

Go's Pure-Go DNS Resolver and the Hosts File Fast Path

Oct 21, 2026 24 min read Jay Hubbert

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 …

GoInternalsDNSNetworkingResolvers

Read more →

Go's regexp: OnePass, Backtrack and the NFA Fallback

Oct 21, 2026 22 min read Jay Hubbert

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 …

GoInternalsRegexpAutomataPerformance

Read more →

Go's Scheduler Steals Half-Idle Cores: Work Stealing, Spinning and the Global Run Queue

Oct 21, 2026 15 min read Jay Hubbert

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.

GoInternalsSchedulerConcurrencyPerformance

Read more →

Go's Slices Are Pointers With a Trick: Capacity, Aliasing and the Growth Algorithm

Oct 21, 2026 18 min read Jay Hubbert

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 …

GoInternalsSlicesMemoryPerformance

Read more →

Go's Sweeper: Lazy Reclamation of Dead Spans

Oct 21, 2026 20 min read Jay Hubbert

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 …

GoInternalsGarbage collectionSweeperMemory

Read more →

← Newer Page 6 of 12 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·