Split Benchmark and Runner into separate classes

- Move Benchmark into benchmarks/base.py
- Reducing dependencies of benchmarks.* modules and only include
  the full module while typing

Change-Id: Ibd1bb1a187078fa6f76fdf637ef18fcb22eb9bc9
Reviewed-on: https://chromium-review.googlesource.com/c/crossbench/+/3904552
Reviewed-by: Patrick Thier <pthier@chromium.org>
9 files changed
tree: ad4827500c1d28fc2bd962f617dab7e72a46082c
  1. crossbench/
  2. docs/
  3. tests/
  4. .gitignore
  5. .pylintrc
  6. .style.yapf
  7. browser.config.example.hjson
  10. poetry.lock
  11. pyproject.toml
  12. README.chromium
  13. README.md
  14. scripts.py


Crossbench is a cross-browser/cross-benchmark runner to extract performance numbers.

This project uses poetry deps and package scripts to setup the correct environment for testing and debugging.

pip3 install poetry

Example usage:

poetry run crossbench speedometer_2.0 \
    --browser=/path/to/chromium \
    --stories=VanillaJS.* \
    --probe=profiling \

Describe all subcommands with stories and all probes:

poetry run crossbench describe

Main Components

Browsers : Interface to start, interact and stop browsers. The main implementions use selenium for maximum system independence.

Probes : Probes define a way to extract arbitrary (performance) numbers from a host or running browser. This can reach from running simple JS-snippets to extract page-specific numbers to system-wide profiling.

Stories : Stories define sequences of browser interactions. This can be simply loading a URL and waiting for a given period of time, or in more complex scenarios, actively interact with a page and navigate multiple times.