RSSAmplifier

Blog

Andrii's Blog

Andrii's Blog Posts

blog.andr2i.comRSS feed ↗8 posts

Latest posts

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.

How 4 bytes of padding make array clearing 49% faster

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.

Optimization catalog. When float division beats integer division

A counterintuitive hot-path optimization from my Go work: swapping integer division (IDIVQ) for floating-point division (DIVSD) to divide integers faster.

Web compression in 2026: brotli, zstd, and compression patterns

A practical tour of compression in Go web servers: static assets, dynamic content, shared dictionaries, training, and streaming. Benchmarking brotli, zstd and gzip.

A regression in code I didn't touch

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.

Notes from Optimizing CPU-Bound Go Hot Paths

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 how I was creating lvm cache volume

Notes on setting up an LVM dm-cache volume on Linux. Partitioning, volume groups, and the pitfalls I hit along the way.

The most efficient way to reuse http request body in go

Performance notes on reusing the body of an outgoing http.Request without redundant allocations and copies in Go middleware.