Eliminating Go bound checks with unsafe
Summary
The article explains bound checks elimination in Go (BCE) and how unsafe pointer arithmetic can eliminate remaining bound checks in hot paths. It covers conventional BCE techniques, examples, and a concrete unsafe implementation to load 4-byte little-endian integers, with benchmark results indicating the unsafe variant can be over 2x faster. It also cautions about safety and the need to prove bounds are unnecessary, and notes build constraints and real-world trade-offs.