browsalyzer
Chrome tracing allows you to automate Chrome benchmarking. It's goal is to provide a JavaScript variant of Telemetry.
Basic Usage
The most basic benchmark is the InitialRenderBenchmark
.
; let control = name: "control" url: "http://localhost:8001/" endMarker: "renderEnd" browser: type: "canary" ; let experiment = name: "experiment" url: "http://localhost:8002/" endMarker: "renderEnd" browser: type: "canary" ; let runner = control experiment;runner ;
In the app you must place a marker to let Chrome Tracing know that you are done rendering. This is done by using a performance.mark
function call.
function endTrace() {
// just before paint
requestAnimationFrame(function () {
// after paint
requestAnimationFrame(function () {
document.location.href = "about:blank";
});
});
}
renderMyApp();
performance.mark("renderEnd");
endTrace();
In the example above we would mark right after we render the app and then call an endTrace
function that ensures that we schedule a micro-task after paint that transitions to a blank page. Internally browsalyzer will see this as the cue to start a new sample.