1.0.0 • Published 5 years ago

exthouse v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Motivation

When measuring real user performance engineers take to the account factors like device and network conditions. But there is one more factor, that is not in direct control - web extensions. They add additional scripts, DOM manipulations, and impact the user experience.

Exthouse is a tool powered by Lighthouse that provides a report about web extension impact on web performance. It measures an extension performance score that helps developers to improve the performance of their extensions and web in general.

Goals:

  1. Highlight one more performance factor affecting web performance.
  2. Identify web extensions that harm web performance.
  3. Provide developers with reports they can use to improve performance.
  4. Show that desktop users may experience unexpected performance issues related to web extensions.

Methodology

Exthouse performs several steps to do analysis:

  1. Launches a browser without extension to evaluate the default performance and store results ./exthouse/result-default-1.json
  2. Launch a browser with installed extension using Puppeteer and stores results to ./exthouse/MY_EXTENTION-1.json
  3. Extends Lighthouse performance categories with additional audits to estimate the impact of the extension:

    • exthouse-new-long-tasks - The value represents a sum of Long Tasks. Long Tasks (weight: 1).
    • exthouse-max-potential-fid-change - The change for the longest task duration highlights the impact on potential First Input Delay (weight: 1).
    • exthouse-extension-files - Extension files add extra CPU consumption for every URL visit. Bundle resources into one and leverage hot chaching. Learn more (weight: 1).
    • exthouse-default-metrics - All metrics collected from the default run (without extension) (weight: 0).
  4. Generates Lighthouse style report using the Lighthouse scoring algorithm.

Environment conditions:

  • Browser: Chromium
  • Emulated form factor: desktop
  • CPU slowdown multiplier: 2
  • More settings in Lighthouse config.

Most of the extensions add tasks to the main thread and affect interactivity metrics:

  • Time to Interactive (TTI) - Time to interactive is the amount of time it takes for the page to become fully interactive. Learn more.
  • First Input Ddelay (FID) - The change for the longest task duration highlights the impact on potential First Input Delay. Learn more.

Analysis of top 10 extensions from Chrome Web Store

This analysis evaluates the top 10 extensions from Chrome Web Store by users count. Extensions are manually filtered to exclude login requirement, not relevant extensions in categories like PLATFORM_APP, or related to specific URLs like *://*.google.com/*.

NameScoreUsers CountFID Δ ( ms )
Grammarly for Chrome5010M114
Adblock Plus5910M118
Skype8210M150
Avira Browser Safety9410M60
Avast SafePrice9910M62
AdBlock10010M0
Google Translate10010M0
Pinterest Save Button10010M0
Tampermonkey10010M0
uBlock Origin10010M0

Usage

Install CLI using npm:

$ npm install --global exthouse

$ exthouse --help

Usage: exthouse [path/to/extension.crx] [options]

Options:
  --runs <number>    amount of runs to evaluate median performance value (default: "1")
  --url <url>        url to evaluate extension performance (default: "https://example.com/")
  --format <format>  output format options: [json,html] (default: "html")
  --disableGather    disable gathering and use /exthouse to produce results
  -V, --version      output the version number
  -h, --help         output usage information

CLI usage examples

# Evaluate extensions with several runs.
# It performs do 3 runs, get median value and generate a report.
$ exthouse Grammarly-for-Chrome.crx --runs=3`

# Generate a report based on existing data:
# It reads results from `/exthouse` folder and generate report.
$ exthouse Grammarly-for-Chrome.crx --disableGather

# Output report in json format
$ exthouse Grammarly-for-Chrome.crx --format=json`

Evaluate any extension

  1. Download extension using https://chrome-extension-downloader.com/
  2. Copy path to the MY_EXTENTION.crx and pass to cli exthouse MY_EXTENTION.crx --runs=3
  3. The process takes a few minutes and results are stored in the Lighthouse report.
  4. All debug data is stored in exthouse folder.

Find downloaded examples extensions folder.

Future Work

  • add support for login script to test extensions required authentication (#22)
  • perform extensions analysis required authentication and compare score w/o authentication. #25
  • experiment with cache (try: warm, hot) to see how scripts are effected by v8 caching. More about cache.
  • experiment with results, running in Chrome and Edge. Add flag browserBinaryPath
  • expose node.js API (#24)
  • experiment with Firefox add-ons (all related work is in the branch firefox-experimental).
  • make repo smaller using bfg-repo-cleaner.

Credits

This tweet has kick-started the initial research and this project.

Development is sponsored by Treo.sh - Page speed monitoring made easy.

npm.io npm.io npm.io