Skip to content
Opensource internals
  • Posts

Go

How Go Allocates Registers: The SSA Backend's Linear Scan Pass

Oct 21, 2026 29 min read Jay Hubbert

Go’s SSA backend uses a greedy linear-scan register allocator that treats the function as one long basic block, moves values into registers just before their use, and spills …

GoInternalsSsaRegister allocationCompiler

Read more →

How Go Copies Strings: slicebytetostring, concatstrings and the Builder Pattern

Oct 21, 2026 17 min read Jay Hubbert

string(b) is a compiler intrinsic that copies unless the bytes are ephemeral, concatenation allocates once via concatstrings with a stack buffer for small results, and …

GoInternalsStringsPerformanceMemory

Read more →

How Go Deletes Your Bounds Checks: The Facts Table That Proves i < len(s)

Oct 21, 2026 17 min read Jay Hubbert

The SSA prove pass tracks relations between values in signed, unsigned and pointer domains, propagates numeric limits, and folds IsInBounds to true so the bounds check disappears.

GoInternalsCompilerBounds checksPerformance

Read more →

How Go Finds a Substring: AVX2 Assembly in internal/bytealg

Oct 21, 2026 22 min read Jay Hubbert

strings.Index dispatches to hand-written SSE/AVX2 assembly in internal/bytealg, uses IndexByte to skip to candidate positions, switches to Rabin-Karp for long needles, and picks …

GoInternalsStringsAssemblyPerformance

Read more →

How Go Handles Signals and Context Cancellation Without Losing Signals

Oct 21, 2026 26 min read Jay Hubbert

Signals land on a thread with a managed signal mask, get bit-packed into a lock-free queue by sigsend, and are forwarded to your channel by one goroutine; context cancellation is a …

GoInternalsSignalsContextConcurrency

Read more →

← Newer Page 8 of 12 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·