Skip to content
Mai Trinh

Blog

Notes on the craft: hard cases I have run into, how I measured them, traced them, and what I learned.

Latest

· 16 min read · Web App

My web game was "fine"… until I measured it

The site felt a bit slow, and I was about to rewrite the server in Rust. Measuring showed the website never ran on that server: the culprit was a CSP line that blocked the CDN cache, and on the relay, a loop that sent the whole list to everyone.

  • Next.js
  • CDN cache
  • CSP
  • WebSocket
  • Load test
  • Measurement

· 12 min read · Android App

When Google Play refunds your customers on its own: lessons from a forgotten consume

Customers paid, got their content, and three days later Google refunded them without anyone asking. No crash, no error on screen. The cause was four small decisions around the consume step, each one reasonable on its own.

  • Google Play Billing
  • In-app purchase
  • Consume
  • State machine
  • Reconciler

· 18 min read · Android App

The ticket said the app used 400 MB because its data lived in RAM. Measuring said otherwise

An 8-sub-ticket refactor plan rested on one assumption: "the data in a static model makes the app heavy". The baseline showed 65% of memory was bitmaps, and moving the main list to a database saved 291 KB. The real wins were an 84.7 MB leak and downloads that couldn't survive process death.

  • Memory leak
  • LeakCanary
  • WorkManager
  • Process death
  • Refactor
  • Measurement