Skip to content

Commit 5ac8577

Browse files
authored
[CI][Benchmarks] optimize layers comparison load (#18674)
Optimize Layer Comparisons data load by preprocessing sets of labels in groups, thus decreasing the charts web page load time.
1 parent b886cbb commit 5ac8577

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

devops/scripts/benchmarks/html/scripts.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,18 @@ function getLayerTags(metadata) {
681681

682682
function processLayerComparisonsData(benchmarkRuns) {
683683
const groupedResults = {};
684+
const labelsByGroup = {};
685+
686+
benchmarkRuns.forEach(run => {
687+
run.results.forEach(result => {
688+
if (result.explicit_group) {
689+
if (!labelsByGroup[result.explicit_group]) {
690+
labelsByGroup[result.explicit_group] = new Set();
691+
}
692+
labelsByGroup[result.explicit_group].add(result.label);
693+
}
694+
});
695+
});
684696

685697
benchmarkRuns.forEach(run => {
686698
run.results.forEach(result => {
@@ -691,13 +703,7 @@ function processLayerComparisonsData(benchmarkRuns) {
691703
if (!metadata) return;
692704

693705
// Get all benchmark labels in this group
694-
const labelsInGroup = new Set(
695-
benchmarkRuns.flatMap(r =>
696-
r.results
697-
.filter(res => res.explicit_group === result.explicit_group)
698-
.map(res => res.label)
699-
)
700-
);
706+
const labelsInGroup = labelsByGroup[result.explicit_group];
701707

702708
// Check if this group compares different layers
703709
const uniqueLayers = new Set();

0 commit comments

Comments
 (0)