Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.86 KB

README.md

File metadata and controls

31 lines (19 loc) · 1.86 KB

The benchmark.py script can be used to run a simple benchmark in Chromium-based browsers. The goal of the script is to collect metrics in a consistent and repeatable way. It is not meant to be representative of real browsing workloads from actual users. This should mainly be used as an example for how to automate the browser for measuring performance for a set of test URLs.

The benchmark script runs two phases:

  • Populating cache - this visits each URL in succession in the same tab to ensure the HTTP disk cache is properly primed. It waits for a period of time after each load. This can be used to capture the traffic and replay later if the benchmark is not going to be used against live sites.
  • Benchmarking - loads each page in a new instance of Chrome and captures data from chrome://histograms.

Prerequisites

Recording traffic

  • In terminal 1 run WPR in recording mode:

    go run src/wpr.go record --http_port=8080 --https_port=8081 capture.wpr

  • In terminal 2 run the benchmark.py script:

    python benchmark.py

The script will visit each site and stay for an interval after that on the same page waiting for additional resources to be fetched. Once it has gone through the populating cache phase, the script can be stopped.

Running the benchmark

  • In terminal 1 run WPR in replay mode:

    go run src/wpr.go replay --http_port=8080 --https_port=8081 capture.wpr

  • In terminal 2 run the benchmark.py script:

    python benchmark.py