不要猜测 — 先测量。 缓慢可能来自客户端、网络、服务器或数据库。有条不紊的方法能找出时间花在哪里,然后修复最大的瓶颈,而不是随意优化。
有条不紊的步骤
text
1. MEASURE → where is the time spent? client render, network, server, DB?
2. REPRODUCE → confirm it reliably (same endpoint, payload, user)
3. TRACE → use APM/distributed traces to find the slow span
4. CHECK RECENT CHANGES → deploys, config, traffic, data growth
5. ISOLATE → layer by layer, narrow to one component
6. FIX the biggest contributor → re-measure to confirm
先测量:时间花在哪里?
使用浏览器 标签和服务器 来分解总耗时。一个有用的分解方式:
