Real performance data for Lighthouse

Can we exclude the user-agent “Chrome-Lighthouse” from crawlers and thereby show Lighthouse the real application view?

Application-view performance

This enables Lightouse in Chrome DevTools and PageSpeed Insights to measure the performance of Discourse like viewed by an user.

Crawler-view performance

Until now Lighthouse measured the performance for an user-device which is rendering the crawler-layout - this never happens in reality.

When they run those lighthose performance tests on a recent iPhone model (even an iPhone 8 or later), I am open to this. Right now android performance is 3x (or more) slower than iPhone unfortunately. :pensive:

Check your device at Speedometer 2.0 to see what I mean – this measures JavaScript performance in the browser:

Until they run lighthouse on an iPhone (any model) for context, I am absolutely opposed to any change here. When they do, I will happily accept the PR, with gusto.

2 Likes

For their metrics they are already collecting “real-user experience data” (CrUX dataset) from ~200 EUR/USD Android phones running Chrome - and this data gets into the Core Web Vitals report on Google Search Console.

How about putting this behind a flag or enable it for development environments only?

You can run lighthouse with a custom user agent from your machine to get the SPA perf numbers.

4 Likes

For this solution to measure the intended Discourse view:

  • mobile-view: add ?mobile_view=1 to the url
  • desktop-view: add ?mobile_view=0 to the url

This setting is remembered in LocalStorage. So reset it once if necessary:
Add ?mobile_view=auto to the url.

1 Like