Skip to content

[Benchmarks] Speed up charts load #18728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions devops/scripts/benchmarks/html/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let suiteNames = new Set();
let timeseriesData, barChartsData, allRunNames;
let activeTags = new Set();
let layerComparisonsData;
let latestRunsLookup = new Map();

// DOM Elements
let runSelect, selectedRunsDiv, suiteFiltersContainer, tagFiltersContainer;
Expand Down Expand Up @@ -342,8 +343,7 @@ function createChartContainer(data, canvasId, type) {
// Create and append extra info
const extraInfo = document.createElement('div');
extraInfo.className = 'extra-info';
latestRunsLookup = createLatestRunsLookup(benchmarkRuns);
extraInfo.innerHTML = generateExtraInfo(latestRunsLookup, data, 'benchmark');
extraInfo.innerHTML = generateExtraInfo(data, 'benchmark');
details.appendChild(extraInfo);

container.appendChild(details);
Expand Down Expand Up @@ -371,11 +371,10 @@ function createLatestRunsLookup(benchmarkRuns) {
const latestRunsMap = new Map();

benchmarkRuns.forEach(run => {
// Yes, we need to convert the date every time. I checked.
const runDate = new Date(run.date);
const runDate = run.date;
run.results.forEach(result => {
const label = result.label;
if (!latestRunsMap.has(label) || runDate > new Date(latestRunsMap.get(label).date)) {
if (!latestRunsMap.has(label) || runDate > latestRunsMap.get(label).date) {
latestRunsMap.set(label, {
run,
result
Expand Down Expand Up @@ -417,7 +416,7 @@ function getDisplayLabel(label, data, metadata) {
return label;
}

function generateExtraInfo(latestRunsLookup, data, type = 'benchmark') {
function generateExtraInfo(data, type = 'benchmark') {
const labels = extractLabels(data);

return labels.map(label => {
Expand Down Expand Up @@ -958,6 +957,7 @@ function initializeCharts() {
barChartsData = processBarChartsData(benchmarkRuns);
layerComparisonsData = processLayerComparisonsData(benchmarkRuns);
allRunNames = [...new Set(benchmarkRuns.map(run => run.name))];
latestRunsLookup = createLatestRunsLookup(benchmarkRuns);

// Set up active runs
const runsParam = getQueryParam('runs');
Expand Down
Loading