Skip to content
Opensource internals
  • Posts

Go

How Go Hashes Map Keys: AES-NI, wyhash and the Seed

Oct 21, 2026 16 min read Jay Hubbert

Map keys are hashed with AESENC on amd64 and arm64 and a wyhash-style fallback elsewhere, with a per-process key XORed with a per-map random seed that is regenerated when a map …

GoInternalsHashingMapsAES

Read more →

How Go Sorts: pdqsort, Pattern-Breaking and the O(n²) Guard

Oct 21, 2026 15 min read Jay Hubbert

Go sorts with pdqsort: median-of-three and Tukey ninther pivots, free sortedness detection from the swap count, seeded xorshift pattern breaking, and a heapsort fallback that caps …

GoInternalsSortingAlgorithmsPerformance

Read more →

How Go's Benchmarking Harness Repeats Until It's Sure

Oct 21, 2026 25 min read Jay Hubbert

testing.B runs your benchmark with a guessed iteration count, measures how long that took, predicts a better count, and repeats until the total hits the -benchtime target.

GoInternalsTestingBenchmarkingPerformance

Read more →

How Go's CPU Profiler Works: SIGPROF, the Signal Stack and 100 Hz Sampling

Oct 21, 2026 20 min read Jay Hubbert

A 100 Hz setitimer(ITIMER_PROF) raises SIGPROF, the handler runs on the gsignal stack, unwinds the running goroutine, and writes samples into a lock-free profBuf ring that …

GoInternalsProfilingSignalsPerformance

Read more →

How Go's crypto Package Uses AES-NI and SHA-NI

Oct 21, 2026 17 min read Jay Hubbert

crypto/aes and crypto/sha256 are now thin shims over crypto/internal/fips140, where CPUID feature bits pick between AES-NI, SHA-NI, AVX2 and generic Go implementations at build and …

GoInternalsCryptoAssemblyPerformance

Read more →

← Newer Page 9 of 12 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·