性能是用户体验的一部分。性能可分为 加载时性能 和 运行时性能。

为什么重要

优秀的性能:加载内容很快,交互反应很及时。这可以节约用户的时间,提升用户的体验。从而降低用户的流失。

度量

性能要度量的维度有很多。可以参考 LightHouse

测试

不同的用户,网络环境,设备的配置是不同的。因此,做性能测试时,要测试不同的环境。不同的环境数据,可以分为 Lab Data 和 Field Data。

Lab Data

Lab data is performance data collected within a controlled environment with predefined device and network settings, while Field data is performance data collected from real page loads experienced by your users in the wild. Each type has its own strengths and limitations.

Field Data

Lab data offers reproducible results and a debugging environment, but might not capture real-world bottlenecks and cannot correlate against real-world page KPIs. With lab data, you need to understand your users’ typical devices and networks and appropriately mirror those conditions when you test performance. Have in mind that even in areas with 4G, users may still experience slower or intermittent connections when in elevators, while commuting, or in comparable environments.

工具

参考文档