blob: cc5eac49e04a8bf0b3e578860d94cdbcd5f19537 [file] [log] [blame]
Copyright 2022 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
<!DOCTYPE html>
<html lang="en">
<title>Go Performance Dashboard</title>
<link rel="icon" href=""/>
<link rel="stylesheet" href="./static/style.css"/>
<script src=""></script>
<script src="./third_party/bandchart/bandchart.js"></script>
<body class="Dashboard">
<header class="Dashboard-topbar">
<a href="">Go Build Coordinator</a>
<li><a href="">Build Dashboard</a></li>
<li><a href="/dashboard">Performance Dashboard</a></li>
<li><a href="">Builders</a></li>
<nav class="Dashboard-controls">
<form autocomplete="off" action="./">
<div class="Dashboard-search">
<input id="benchmark-input" type="text" name="benchmark" placeholder="Type benchmark name..." />
<input type="submit" />
<li><a href="?benchmark=all">All benchmarks</a></li>
<li><a href="?benchmark=regressions">Regressions first</a></li>
<span class="left-separator"></span>
Duration (days):
<div class="Dashboard-duration">
<input id="days-input" type="number" name="days" value="30" />
End (UTC): <input id="end-input" type="datetime-local" name="end" />
<input type="submit">
<div class="Dashboard-documentation">
Each graph displays benchmark results relative to its baseline
commit, which is the latest stable release (e.g., 1.18.3) at
the time of testing. The 95% confidence interval is displayed
in light gray. On hover, the graph displays the benchmarked
commit at that point (click to view full commit).
Note that some commits are not tested, so there could be
multiple commits (not shown) between two points on the graph.
See the <code>linux-amd64-perf</code> column on the
<a href="">x/benchmarks build dashboard</a>
for tested ("ok") / untested (empty) commits.
<div id="dashboard">
<h2 class="Dashboard-title" id="loading">Loading...</h2>
function removeLoadingMessage() {
let loading = document.getElementById("loading");
function addContent(benchmarks) {
let dashboard = document.getElementById("dashboard");
let prevName = "";
let grid = null;
for (const b in benchmarks) {
const bench = benchmarks[b];
if (bench.Name != prevName) {
prevName = bench.Name;
let link = document.createElement("a");
link.href = "?benchmark=" + bench.Name;
link.innerHTML = bench.Name;
let title = document.createElement("h2");
grid = document.createElement("grid");
let item = document.createElement("div");
item.appendChild(BandChart(bench.Values, {
unit: bench.Unit,
function failure(name, response) {
let dashboard = document.getElementById("dashboard");
let title = document.createElement("h2");
title.innerHTML = "Benchmark \"" + name + "\" not found.";
let message = document.createElement("p");
response.text().then(function(error) {
message.innerHTML = error;
// Fill search boxes from query params.
function prefillSearch() {
let params = new URLSearchParams(;
let benchmark = params.get('benchmark');
if (benchmark) {
let input = document.getElementById('benchmark-input');
input.value = benchmark;
let days = params.get('days');
if (days) {
let input = document.getElementById('days-input');
input.value = days;
let end = params.get('end');
let input = document.getElementById('end-input');
if (end) {
input.value = end;
} else {
// Default to now.
let now = new Date();
// toISOString always uses UTC, then we just chop off the end
// of string to get the datetime-local format of
// 2000-12-31T15:00.
// Yes, this is really the suggested approach...
input.value = now.toISOString().slice(0, 16);
// Fetch content.
let benchmark = (new URLSearchParams('benchmark');
let dataURL = './data.json' +; // Pass through all URL params.
.then(response => {
if (!response.ok) {
failure(benchmark, response);
throw new Error("Data fetch failed");
return response.json();
.then(function(benchmarks) {
// Convert CommitDate to a proper date.
benchmarks.forEach(function(b) {
b.Values.forEach(function(v) {
v.CommitDate = new Date(v.CommitDate);