Eliminating Go bounds checks with unsafe
Hot path optimization: unsafe pointer arithmetic to eliminate bound checks the Go compiler can't remove, given you can prove they are truly unnecessary.
Andrii's Blog Posts
Hot path optimization: unsafe pointer arithmetic to eliminate bound checks the Go compiler can't remove, given you can prove they are truly unnecessary.
An alignment quirk on Intel and AMD CPUs: keeping a Go array 8-byte aligned (vs offset 4) makes clearing it up to 49% faster, thanks to how REP STOSQ works.
A counterintuitive hot-path optimization from my Go work: swapping integer division (IDIVQ) for floating-point division (DIVSD) to divide integers faster.
A practical tour of compression in Go web servers: static assets, dynamic content, shared dictionaries, training, and streaming. Benchmarking brotli, zstd and gzip.
How a change to one Go function slowed unrelated code by 3%. A deep dive into L1 instruction cache set conflicts, associativity, and code alignment in Go.
Lessons from porting Brotli to pure Go. Why generics, interface dispatch, and closures cost performance on hot paths, and what to do instead.
Notes on setting up an LVM dm-cache volume on Linux. Partitioning, volume groups, and the pitfalls I hit along the way.
Performance notes on reusing the body of an outgoing http.Request without redundant allocations and copies in Go middleware.