Skip to content
Opensource internals
  • Posts

Go

How Go's GC Decides When to Collect: Heap Goal, Pacing and Mark Assist

Oct 21, 2026 16 min read Jay Hubbert

The Go pacer computes a heap goal from GOGC and the soft memory limit, triggers below it, dedicates 25% of GOMAXPROCS to marking, and makes mutators repay an assist debt as they …

GoInternalsGarbage collectionPacingPerformance

Read more →

How Go's io.Copy Avoids Copying: sendfile, splice and the Copy Protocol

Oct 21, 2026 15 min read Jay Hubbert

io.Copy dispatches to WriterTo and ReaderFrom, and net.TCPConn implements both with sendfile and splice, so a file-to-socket copy never touches user space.

GoInternalsIoNetworkingPerformance

Read more →

How Go's JSON Parser Avoids Reflection: The Scanner and the v2 Experiment

Oct 21, 2026 22 min read Jay Hubbert

encoding/json scans and decodes in two separate passes over the input, caching every per-type decision, while the experimental v2 splits the grammar into a jsontext syntax layer …

GoInternalsJSONEncodingPerformance

Read more →

How Go's Race Detector Works: Shadow Memory and Vector Clocks

Oct 21, 2026 19 min read Jay Hubbert

The Go race detector is LLVM’s ThreadSanitizer shipped as a prebuilt blob: the compiler inserts read and write hooks, the runtime maps shadow memory for the heap and globals, and …

GoInternalsRace detectorConcurrencyThreadsanitizer

Read more →

How Go's reflect Package Reads Types: The rtype and the Method Table

Oct 21, 2026 13 min read Jay Hubbert

reflect reads the runtime’s own abi.Type descriptors; a reflect.Value is a (typ, ptr, flag) triple whose flag word encodes kind, indirection, addressability and read-only state in …

GoInternalsReflectionRuntimePerformance

Read more →

← Newer Page 10 of 12 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·