Running and analyzing LoadLine 1 and 2 benchmarks on Android using Crossbench. Use when you need to measure page loading performance, evaluate performance-related changes in Chrome, or collect Perfetto traces with realistic Chrome workload.
This skill guides the usage of LoadLine benchmarks to measure browser page loading performance by simulating real-world user journeys (loading a web page).
Read third_party/crossbench/config/benchmark/loadline2/README.md for basic
info on the LoadLine benchmark.
The entry point for all LoadLine benchmarks is the Crossbench script:
third_party/crossbench/cb.py
third_party/crossbench/cb.py <variant> --browser=<browser> --stories=<stories> --repetitions=<N>
| Variant | Description |
|---|---|
loadline2-phone | The latest LoadLine 2 benchmark optimized for mobile phones. |
loadline2-tablet | LoadLine 2 benchmark optimized for tablets. |
loadline-phone | Legacy LoadLine 1 benchmark for phones. |
loadline-tablet | Legacy LoadLine 1 benchmark for tablets. |
*-debug | Appends more tracing categories for easier debugging. |
--browser)--browser=adb:chrome (if one device) or
--browser=$SERIAL:chrome.--browser=out/Release/chrome.--browser=chrome-stable, chrome-canary, etc.--stories)Default stories for LoadLine 2:
amazon_productcnn_articlewikipedia_articleglobo_homepagegoogle_search_resultSkip --stories flag to run everything or provide a comma-separated list for
specific stories.
LoadLine outputs two kinds of numbers: scores and breakdown.
Scores are in runs-per-minute, so higher is better. The main metric is called TOTAL_SCORE, this is the most stable and representative number.
Breakdown values are in milliseconds, so lower is better. Can be useful for analyzing which loading stage was affected in particular.
You can find the exact version of Chrome being tested in the benchmark logs by
looking for the 🏷️ STARTING BROWSER Version: line:
🏷️ STARTING BROWSER Version: 138.0.7204.168 stable
Run the full benchmark on a connected Android device:
third_party/crossbench/cb.py loadline2-phone --browser=adb:chrome
See if a feature flag affects page loading performance:
third_party/crossbench/cb.py loadline2-phone --browser-config=feature_flag.hjson
where feature_flag.hjson looks like this:
{
flags: {
"experiment": {
"enabled": "--enable-features=YourFeature",
"disabled": "--disable-features=YourFeature",
},
},
browsers: {
"chrome": {
browser: "chrome",
driver: "adb",
flags: [ "experiment" ],
},
},
}
Check if clank/bin/install_chrome.py exists. If not (chromium-only checkouts),
see the next section for building Chromium locally.
Use clank/bin/install_chrome.py to install past versions on the connected
device. E.g.
clank/bin/install_chrome.py --channel dev --milestone 146 --signed
will install M146 with "Dev" channel branding. You can use multiple brandings to compare versions on the same device. E.g. install Canary:
clank/bin/install_chrome.py --channel canary --milestone 147 --signed
And then run LoadLine with two browsers:
third_party/crossbench/cb.py loadline2-phone --browser=adb:chrome-dev --browser=adb:chrome-canary
This will compare M146 and M147 on the same device.
android_channel="canary" gn arg.adb shell pm uninstall com.chrome.canary (this command fails if it's not
installed; this is fine and can be ignored)adb install out/$OUT_DIR/apks/Chrome.apkthird_party/crossbench/cb.py loadline2-phone --browser=adb:chrome-canaryBefore running a full run on a custom-built Chrome, first try with a single repetition
third_party/crossbench/cb.py loadline2-phone --browser=adb:chrome-canary --repetitions=1
Don't trust the numbers, they are going to be very noisy. Do it just to verify that the benchmark runs without errors.