Dùng DevTools để profile CPU, memory và frame rendering.
- Kiểm tra jank (frame bị bỏ) qua tab Performance.
- Xác định frame chậm và dùng profiler xem function nào tốn thời gian.
- Với memory leak, chụp heap snapshot và so sánh trước/sau.
- Tối ưu bằng: dùng
const, lazy-load list, tránh widget tree quá sâu, chuyển công việc nặng sang isolate, và dùngRepaintBoundaryđúng chỗ.
Use DevTools to profile CPU, memory, and frame rendering.
- Check for jank (dropped frames) via the Performance tab.
- For memory leaks, take heap snapshots and compare.
- Optimize by using
const, lazy-loading lists, avoiding deep widget trees, and moving heavy work to isolates.