Things I've written down.
Ruby, Rails, performance, security and applied machine learning. Updated when something feels finished.
The 55% page-load win was four queries and a cache key
Cutting clinical-study page loads by more than half under real traffic. Not a rewrite — profiling, eager loading, and one honest look at what was cacheable.
Everything that runs before your controller
A Rails request passes through twenty-odd middleware before your code sees it. Knowing the stack turns a class of mystery into a list.
Time zones: store UTC, and know which "now" you called
Most time-zone bugs come from two nearly identical methods and one place where dates are not really times.
The tests worth writing
Coverage measures which lines ran, not whether anything is verified. What actually catches regressions is narrower and cheaper than a coverage target.
YJIT is free performance, until you read the memory graph
15–30% faster for a flag you probably already have on. What it costs per worker, and the one case where you should turn it down rather than off.
Processing a million rows without loading a million rows
`map` builds an array. On a large collection that array is the problem, and the fix is usually one method name.
Stop guessing: profiling Ruby properly
Benchmarking a suspicion confirms the suspicion. A sampling profiler tells you where the time actually went.
Retries fell 30% when I stopped retrying the wrong things
A retry is a bet that the failure was temporary. Most retried jobs were losing that bet — and the ones that won were doing their work twice.
Reading a query plan without fear
EXPLAIN output looks impenetrable and answers three questions. Those three cover most of what makes a query slow.