为什么使用开发工具和 Web UI 通过 Light House 审计网站的结果会有差异?

huangapple go评论92阅读模式
英文:

Why there is difference in result if I audit a website using Light house through DevTool and Web UI

问题

我正在尝试使用Google Lighthouse对网站进行审核。根据这个页面https://developer.chrome.com/docs/lighthouse/overview/,我尝试使用Web UI和DevTools对一个网站进行审核。但是结果是不同的,即使几乎同时进行。

附上截图:

为什么使用开发工具和 Web UI 通过 Light House 审计网站的结果会有差异?

为什么使用开发工具和 Web UI 通过 Light House 审计网站的结果会有差异?

其中有4个参数,有2个是匹配的,但另外2个参数显示有差异。

英文:

I am trying auditing website using Google lighthouse. As given on this page https://developer.chrome.com/docs/lighthouse/overview/ I tried auditing a website using Web UI and DevTools. But results are different even though hitting almost at same time
PFA screenshot为什么使用开发工具和 Web UI 通过 Light House 审计网站的结果会有差异?

为什么使用开发工具和 Web UI 通过 Light House 审计网站的结果会有差异?

Out of 4 2 parameters are matching but other 2 parameters are showing differences

答案1

得分: 1

灯塔评分会因多种因素而在一定范围内变化,从页面内容随时间变化到在不同机器和不同网络上进行测试。

性能工具只能控制其中的一部分;根据您的性能比较需求,您可以通过一些步骤进一步减少变异,例如:

  • 仅在单台机器上进行测量(与本地 DevTools 或 Google 服务器上的 PageSpeed Insights 进行比较)
  • 控制页面内容,以确保不同的测试不会落入 A/B 测试的不同分支,或者在不同的加载中获取不同的广告内容
  • 更深入的方法,如严格控制 CPU 限制和使用更真实(但侵入性更大)的网络限制

灯塔有一些关于这些主题的文档:

英文:

Lighthouse scores will vary within some range due to a number of factors, from the page content changing over time to testing on different machines on different networks.

Performance tools can only control for some of this; depending on your performance comparison needs, you can work to further reduce the variance through a number of steps, like

  • only measuring on a single machine (vs in local DevTools vs PageSpeed Insights on one of Google's servers)
  • controlling page content so you know different tests e.g. aren't falling in different branches of an A/B test, or getting different ad content in different loads
  • more in-depth methods, like strictly controlling CPU throttling and using more realistic (but invasive) network throttling

Lighthouse has a few docs on these topics:

huangapple
  • 本文由 发表于 2023年8月9日 01:40:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76861993.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定