I was trying to improve by Muhammad UnainI was trying to improve by Muhammad Unain

I was trying to improve

Muhammad Unain

Muhammad Unain

I was trying to improve latency in Amanises.
The database wasn't actually the only problem.
Amanises is built with Next.js, Hono, Cloudflare Workers, and AI, so a single user action can end up going through quite a few things:
→ API request → Database → AI processing → Response → Back to the client
I started tracing the request flow instead of looking at each part separately.
And I found something pretty simple: some requests were doing work they didn't actually need to do.
Some database calls could be avoided. Some data could be reused instead of fetched again. And some AI flows could be handled more efficiently instead of triggering another request every time.
So I started moving the logic around and reducing unnecessary calls.
The result: fewer database calls per request, less repeated fetching, and fewer extra AI requests. The app feels noticeably snappier.
The interesting part was that I didn't need some huge optimization. I just needed to stop doing unnecessary work.
That's probably my biggest takeaway from this:
Performance isn't always about making things faster. Sometimes it's about asking: "Do I need to do this at all?"
Still building Amanises, but these changes made the request flow a lot cleaner and gave me a much better understanding of how the app behaves once Next.js, Hono, Workers, databases, and AI all start talking to each other.
If your app feels slow and you can't figure out why, DM me, happy to take a look.
What's the most unnecessary work you've found hiding in your own app?
More of my work: unainr.vercel.app
Like this project

Posted Oct 13, 2026

I was trying to improve latency in Amanises. The database wasn't actually the only problem. Amanises is built with Next.js, Hono, Cloudflare Workers, and AI,...