Blog

Everything I can write.

  • The Roofline Model on a Laptop: Measuring the Bandwidth Slope, the FMA Ceiling and the Ridge

    Arithmetic intensity and the bound P = min(π, βI), with the bandwidth roof and FMA ceilings measured in C on one core of an Apple-silicon laptop, and a kernel walked across the ridge.

    13 min read 2,531 words Category: HPC Tags: roofline, memory bandwidth, performance modeling

  • From Reflected XSS to a Real Content-Security-Policy

    How script injection actually happens, why output encoding and CSP are different layers, and how to roll out a nonce-based policy without breaking production.

    9 min read 1,797 words Category: Security Tags: web security, xss, csp

  • Designing a URL Shortener, Properly

    Requirements, back-of-the-envelope capacity numbers, the data model, base62 versus hashing for IDs, and what to do when one link goes viral.

    11 min read 2,102 words Category: Software Tags: system design, databases, caching