Switch language한국어
Back to the list

AI created slow and expensive code. How I analyzed and fixed it.

TL;DR AI

Key summary

2 min read
  1. An AI-built browser game portal started exceeding Firebase free-tier limits and slowing down.

  2. The developer used billing, query, and latency metrics to pinpoint the worst hotspots.

  3. The main issues were inefficient Firestore access in a nightly cleanup job, a heavy profile endpoint, and an expensive random-seed generator.

  4. They began replacing broad scans and repeated queries with more targeted Firestore reads to cut cost and latency.

Read the original