The cache was working perfectly. That was the problem.
A 99.2% hit rate hid nine cache stampedes. What singleflight fixed, what it did not, and the two bugs that only exist under concurrency.
Optimisation work, written up in long form — including the wrong turns.
A 99.2% hit rate hid nine cache stampedes. What singleflight fixed, what it did not, and the two bugs that only exist under concurrency.
An atomic-first Go Bloom filter still tripped the race detector. A war story about the read that looked benign, and what the Go memory model has to say about it.
Rank and select turn two expensive log queries into constant-time lookups. What that costs, what it buys, and why the same code can honestly report both 2ns and 13ns.
A line-by-line reading of avx2.s: runtime AVX2 detection, and hand-written Go assembly for population count, bitwise OR and AND, and clearing 32 bytes at a time.
Making the Bloom filter thread-safe cost 8–12x in throughput. The culprit was a heap allocation on every Add and Contains; the fix was a stack array for small hash counts.
Concurrent reads were panicking in a Go Bloom filter because Contains() quietly mutated shared scratchpad state. How the race was found, fixed, and what the fix cost.
A benchmark that measured fmt.Sprintf instead of the filter, several pprof sessions, one optimisation that made things worse, and the data-structure change that finally paid.
Gall's Law, Lehman, Brooks, Wirth and the rest — each with the project that ignored it, the project that respected it, and a story from my own trenches.
What computational fluid dynamics actually is — the history from Euler to WENO schemes, why analytical solutions and wind tunnels both hit walls, and where the hard parts lie.
The Navier–Stokes equations from four playground ideas — mass, momentum, viscosity and pressure — through Euler, Navier and Stokes to the vector calculus that writes them down.
A comprehensive exploration of a cache-line optimized Bloom filter implementation in Go with SIMD acceleration and assembly integration.
Bringing AVX2 to Project Euler 38 — what 256-bit registers buy when the same pandigital check runs over thousands of candidates, and how the C++ compares to scalar code.
Vectorising Project Euler 38 in MATLAB: build the concatenated products as a matrix, test every candidate in one pass, and let the language do what it is actually good at.
A C# solution that prunes by digit length instead of brute-forcing: the constraint that the products must total nine digits bounds k to a handful of ranges.
Turning the brute-force Python solution lean: integer concatenation instead of strings, a 10-bit mask for the pandigital test, and early exits that prune the search.
A step-by-step Python solution to Project Euler 38: why the search stops at 9999, how to build each concatenated product, and a straightforward pandigital check.
Project Euler 38 without a computer: digit-count arithmetic narrows the search to four-digit numbers starting with 9, and the rest is pen, paper and a little logic.
What makes 192384576 special, and why concatenating the multiples of 9327 gives the largest 1–9 pandigital number you can build this way. No code, just the puzzle.
New posts by email. Long-form optimisation writeups, a few times a year. No tracking, no other mail, one click to leave.
Or take the RSS feed — the whole archive, an opening summary and a link for each post.