/chromium-profiler

Primary LanguageJavaScriptOtherNOASSERTION

chromium-profiler

Chromium-profiler is a utility to test some web page cases in Chromium, meant to profile Chromium for PGO.

Why?

  • Current versions of Google Chrome are compiled with PGO (Profile Guided Optimizations). We also want this for Chromium.

  • Chromium source code contains documentation for how to compile with PGO, but

    1. The tools/perf/run_benchmark utility used for profiling depends on vpython and various other stuff (most of that is bundled in Chromium sources, but not all).
    2. The profiling cases for the tools/perf/run_benchmark need Web Page Replay archives, which Google does not share publicly.

    For automatized profiling the community therefore needs to create it's own Web Page Replay archives.

Dependencies

How to use

To run all test cases, run

./chromium_profiler.py --chrome-executable PATH_TO_CHROME --chromedriver-executable PATH_TO_CHROMEDRIVER

replacing PATH_TO_CHROME and PATH_TO_CHROMEDRIVER as needed. On amd64 Gentoo, for example, these are /usr/lib64/chromium-browser/chrome and /usr/lib64/chromium-browser/chromedriver.

If Chromium is compiled to generate LLVM profiling data, the results will be stored in various files in a temporary directory and removed after the run. If the --profile-output option is specified, the profiling results of all the runs will be incrementally merged with the llvm-profdata utility into the file specified by that option. Thus the llvm-profdata utility must be in the PATH environment variable if --profile-output option is specified.

To list available cases, use the --list-cases option.

To test specific cases, use the --case option, which accepts glob-style patterns and can be used multiple times.

To use additional arguments for starting the browser, use the --add-arg option.