英文:
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对一个网站进行审核。但是结果是不同的,即使几乎同时进行。
附上截图:
其中有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
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:
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论