Subject: Re: bug#71644: 30.0.50; Severe slowdown in larger files with markers beginning in emacs 29+

From: Stefan Monnier <[email-masked]>
Date: Wed, 26 Jun 2024 10:08:37 -0400

>> Yes, definitely.  The threshold is at about N/100 where N is the number
>> of markers/headings.  But why 100?
>
> Maybe because
>
> bytepos - best_below_byte > 5000
> and distance += BYTECHAR_DISTANCE_INCREMENT;
> (BYTECHAR_DISTANCE_INCREMENT = 50)
>
> Then, (/ 5000 50) ; -> 100.
>
> In other words,
> for (tail = BUF_MARKERS (b); tail; tail = tail->next)
> loop is roughly bound to (min number-of-markers 100)-ish
> repetitions. So, once the number of markers exceeds 100, there is no
> more scaling with the marker number.

I'm sorry, I don't understand what you're trying to say:

The histogram is showing the number of iterations of this loop,
and the threshold is not at 100 but at 800 (a.k.a number of markers /
100).

        Stefan