~/talk

From 3000ms to 300ms: Lessons learned from optimizing Tanstack ...

Talkat JNation 2026 · 2026-05-26..05-27· [web-performance, frontend-architecture]
slides:none on file

Images AI is a vibe‑coded image generator built with TanStack Start, Hono, Cloudflare D1 + Drizzle, R2, BetterAuth, Stripe, deployed to Cloudflare Workers with Alchemy and Sentry for observability. Initial server latency is 3000ms to 300ms after fixes: deduplicate session fetch by moving it to route context, parallelize balance/subscription/gallery (critical first), add a DB index on reference_id, move BFS edit traversal into a single SQL query so the chain query 3s to 22ms, lazy‑load UI chunks and replace stateful scroll logic with refs, cutting the initial payload (~900KB) and JS by ~50%.

AI-written summary · about

  1. 0:00Introduction and setup
  2. 2:11Introducing the Images AI app
  3. 5:03Performance issues in production
  4. 6:29Debugging redundant API calls
  5. 8:34Optimizing dashboard loading time
  6. 10:21Fixing unindexed database queries
  7. 11:26Optimizing image edit queries
  8. 14:00Reducing initial payload size
  9. 16:48Optimizing UI and React code
  10. 17:50Implementing caching strategies
  11. 18:55Key takeaways and future improvements
  12. 21:43Q&A and closing remarks
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.