Skip to content

Performance results from CLI, Node, Audit and Extension are very different #9957

@rubyzhao

Description

@rubyzhao

Provide the steps to reproduce

There are 4 ways to use Lighthouse

  1. Audits in Chrome DevTools
  2. Chrome Lighthouse Extension
  3. Node CLI
  4. Node Module

Setup the server

  1. Fetch html
  2. Only change one line: var Loop=2e7 to see the difference.
  3. Open this with Live Server [^1]

Get the 4 different results

  1. F12, Click Audits, Get
    Audit.zip
  2. Run Lighthouse Extension, Get
    Extension.zip
  3. Run Lighthouse CLI: lighthouse http://127.0.0.1:5501/Canvas_Sin.html --view --output-path=LightHouse_Output\Canvas --output=html --only-categories=performance
    Get Canvas.report.html output.zip
  4. Follow Node Module
    Get result
    Node_LightHouseOutput.zip

What is the current behavior?

Please see the part of performance results from 4 different ways. All 4 ways use same setting:
image

  1. Performance from Audits:
    CPU/Memory Power: 680
    image

  2. Performance from Extension:
    CPU/Memory Power: 613
    image

  3. Performance from node CLI:
    CPU/Memory Power: 540
    image

  4. Performance from node Module:
    CPU/Memory Power: 707
    image

What is the expected behavior?

The 4 ways should give very close result. But there are a lot of difference.

  1. Why CPU/Memory is so different for 4 ways? How this is calculated?
  2. Max Potential First Input Delay is huge different, from 20 to 7820ms.
  3. For other performance, First Contentful Paint,First Meaningful Paint,Speed Index,First CPU Idle and Time to Interactive, although Audit is close to Extension; CLI is close to Module, but there is about 1.6 times difference between CLI and Audit.

What is the best way we should use in the future?

Based on the above performance result, Node Module gives the best performance result. Extension shows the worst performance.

Environment Information

  • Lighthouse version: 5.6.0
  • Lighthouse Extension: 5.6.0
  • Chrome version: 78.0.3904.97
  • Node.js version: 12.11.1
  • Operating System: Win10X64 1803
  • VS Code: Version: 1.40.0
  • [^1] Live Server Plugin of VS Code: 5.6.1

Related issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions