From e59c9b072231b8dff901a3ca507b9a78cd29647f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Naz=C4=B1m=20Can=20Alt=C4=B1nova?= Date: Tue, 23 Jan 2024 13:10:12 +0100 Subject: [PATCH] Bring the max stacking depth limit back for marker timings --- src/profile-logic/marker-timing.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/profile-logic/marker-timing.js b/src/profile-logic/marker-timing.js index 0f280838d7..8635198b75 100644 --- a/src/profile-logic/marker-timing.js +++ b/src/profile-logic/marker-timing.js @@ -10,6 +10,10 @@ import type { MarkerTimingAndBuckets, } from 'firefox-profiler/types'; +// Arbitrarily set an upper limit for adding marker depths, avoiding very long +// overlapping marker timings. +const MAX_STACKING_DEPTH = 300; + /** * This function computes the timing information for laying out the markers in the * MarkerChart component. Each marker is put into a single row based on its name. In @@ -163,6 +167,12 @@ export function getMarkerTiming( continue; } + if (markerTimingsForName.length >= MAX_STACKING_DEPTH) { + // There are too many markers stacked around the same time already, let's + // ignore this marker. + continue; + } + // Otherwise, let's add a new row! const newTiming = emptyTiming({ instantOnly: false }); addCurrentMarkerToMarkerTiming(newTiming);