项目性能优化

81 阅读1分钟

以下内容为个人方便记忆使用。

1. 排查工具
  • Chrome浏览器 Performance

  • Chrome浏览器 more tools -> Performance monitor

    1213309-20211128234253849-654506023.gif

  • Chrome浏览器 React Developer Tools 插件

    勾选 General 下的 Highlight updates when components render.

  • Chrome浏览器 LightHouse

    image.png

2. 优化工作
  • 防抖操作

  • 数据拆分

  • 组件添加是否需要更新的判断。React.PureComponentuseMemo()

  • 组件优化,数据缓存。如:虚拟长列表

  • 资源拆分、压缩、缓存

    image.png

3. 文章