Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observing consistently lower performance scores when running Lighthouse programmatically than from Chrome DevTools #10062

Closed
wolvriene opened this issue Dec 2, 2019 · 17 comments

Comments

@wolvriene
Copy link

Settings Used in both Programmatically and DevTool audit are same and are listed below .
Chrome Version : 78.0.3904.108
Node.js version: 13.1.0
Device :Desktop
Audits: Performance
Throttling : No Throttling(Provided by environment)
Other details provided by report:
User agent (host): Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/78.0.3904.108 Safari/537.36
User agent (network): Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Safari/537.36 Chrome-Lighthouse

Ran audit on Devtool and by Programmatically .Results are different .
Programmatic Performance Score: 22
First Contentful Paint
1.7 s
Speed Index
4.0 s
Time to Interactive
6.5 s
First Meaningful Paint
4.4 s
First CPU Idle
6.5 s
Max Potential First Input Delay
280 ms

DevTools Performance Score: 82
Metrics
First Contentful Paint
0.7 s
Speed Index
2.8 s
Time to Interactive
5.0 s
First Meaningful Paint
5.0 s
First CPU Idle
5.0 s
Max Potential First Input Delay
480 ms
Please revert if any other additional information is required .

@patrickhulce
Copy link
Collaborator

How are you setting "no throttling" programmatically? Are you disabling the storage reset in DevTools?

@wolvriene
Copy link
Author

Hi @patrickhulce
i have set "no throttling " programatically as below

       disableNetworkThrottling: true,
       disableCpuThrottling: true,
       throttlingMethod: 'provided',

Also disabled the storage reset in DevTools as "Clear storage"
attached in screenshots.
Please let me know for any changes
Screenshot 2019-12-02 at 11 51 08 PM

@patrickhulce
Copy link
Collaborator

Hm, that is how you set no throttling in programmatic so everything looks good there (just throttlingMethod: 'provided' should be all that's needed). The only other thing that seems to be different is headless vs. headful Chrome.

Is this URL public for us to reproduce the issue?

@wolvriene
Copy link
Author

@patrickhulce
I checked with both headless and headful Chrome .
There is no much difference, Observing consistently lower performance scores even in headful (Programmatically)

URLs are not public

@wolvriene
Copy link
Author

Hi @patrickhulce
Any update on this ?
Thanks

@patrickhulce
Copy link
Collaborator

Wait @wolvriene something is not right with the numbers you've reported. You shouldn't be getting anywhere near a 22 with those metric values.

image

In fact the difference in the metric values themselves is pretty well within the range of reasonable variance for different Chrome variants

@wolvriene
Copy link
Author

wolvriene commented Dec 9, 2019

@patrickhulce :
Please find a different screenshot with similar kind of number in which i am getting score as 22%.
I tried with lh-scorec-calc getting score 71%, is there any setting/configuration need to change ?

Screenshot 2019-12-09 at 3 47 16 PM

Screenshot 2019-12-09 at 3 57 45 PM

@patrickhulce
Copy link
Collaborator

patrickhulce commented Dec 9, 2019

Oooooh, is your version of programmatic newer than the DevTools version of Lighthouse?

Newer Lighthouse will automatically adjust the scores to desktop curves while older stable DevTools does not yet do this. This would explain the score discrepancy.

@wolvriene
Copy link
Author

wolvriene commented Dec 10, 2019

@patrickhulce
i am using Programmatic lighthouse version: 5.6.0

How to check lighthouse DevTool version ?
i am using Chrome Version : 78.0.3904.108

And, also which Performance score report is correct or trustable, DevTool or Programmatic ? As there is huge difference between them.

@patrickhulce
Copy link
Collaborator

The DevTools Lighthouse version can be found at the bottom of every report, Chrome 78 is 5.2.0.
image

The programmatic one in this case is more reflective of the performance because it contains the fix for adjusting score weights.

@wolvriene
Copy link
Author

wolvriene commented Dec 10, 2019

@patrickhulce

Lighthouse Version are same for DevTool and programmatic are same i.e. 5.6.0
Please find screenshot for the same.

Screenshot 2019-12-10 at 9 01 41 PM

But still there is huge difference Performance score between them.

Also, Could you please provide more specific about score weights and how it actually works.

@patrickhulce
Copy link
Collaborator

That's not the right report @wolvriene, we already know that programmatic is 5.6.0. The DevTools report could not possibly be produced by HeadlessChrome and if you're using Chrome 78, the Lighthouse version is 5.2.0.

Also, Could you please provide more specific about score weights and how it actually works.

There are different score curves for desktop and mobile, the mobile curve is more forgiving. When you test as a desktop device, in 5.6.0 it uses the desktop curve for the score. In older versions (i.e. 5.2.0), the desktop curve was not enforced properly and so the more forgiving curve was used instead which resulted in erroneously higher scores.

static get defaultOptions() {
return {
mobile: {
// 75th and 95th percentiles HTTPArchive -> median and PODR
// https://bigquery.cloud.google.com/table/httparchive:lighthouse.2018_04_01_mobile?pli=1
// see https://www.desmos.com/calculator/2t1ugwykrl
scorePODR: 2000,
scoreMedian: 4000,
},
desktop: {
// SELECT QUANTILES(renderStart, 21) FROM [httparchive:summary_pages.2018_12_15_desktop] LIMIT 1000
scorePODR: 800,
scoreMedian: 1600,
},
};
}

const scoreOptions =
context.options[artifacts.TestedAsMobileDevice === false ? 'desktop' : 'mobile'];

@wolvriene
Copy link
Author

@patrickhulce

Thanks for the update
Yes in DevTool version is 5.2.0, Apologies for Incorrect screenshot, mistakenly i have uploaded it
I will more look into score weights and will close ticket shortly.

@wolvriene
Copy link
Author

@patrickhulce

I have updated chrome and current Version is 79.0.3945.79, lighthouse version is 5.5.0

Does lighthouse version is 5.5.0 is having fix for adjusting score weights.

Also i Checked with Chrome Canary Version Version 81.0.3992.4, lighthouse version is 5.7.0.
Assuming it is having fix for adjusting score weights.But it does not have throttling option.

Is there any way i can compare programmatic lighthouse results with DevTools lighthouse results and conclude the same.

As there is huge difference between the performance score between them.

@patrickhulce
Copy link
Collaborator

Is there any way i can compare programmatic lighthouse results with DevTools lighthouse results and conclude the same.

tl;dr - Yes but not with the settings you have.

First of all, to be clear, the metric results themselves should still be comparable between your two reports, it's just the scoring curve we're talking about here. The only versions of Lighthouse in DevTools that support the score curve adjustments have also removed the throttling setting, so you must use simulated throttling from the command line to see similar scores.

FWIW, that specific commit I'm referring to might not have reached DevTools yet either, so it might take a bit of time to reach Canary.

@wolvriene
Copy link
Author

@patrickhulce

Please correct me if i am wrong, so only Performance score will be affected by score curve, not other metrics for light house such as First Contentful Paint , speed index , Time to Interactive etc.

@patrickhulce
Copy link
Collaborator

patrickhulce commented Dec 12, 2019

Performance score will be affected by score curve, not other metrics for light house such as First Contentful Paint , speed index , Time to Interactive etc.

Correct, the raw metric values are unaffected by the score curve. The score curve is only for the performance score. (Note that the text color of the metrics might be different based on the score curve, but the value itself should not be affected)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants