Subject: Re: bug#79132: 30.1; lots of overlays with box face causes high usage of redisplay_internal

From: Eli Zaretskii <[email-masked]>
Date: Thu, 31 Jul 2025 13:15:15 +0300

> Date: Thu, 31 Jul 2025 11:57:55 +0200
> From: Godefroy Vannoye <[email-masked]>
> 
> While using flymake with flymake-show-diagnostics-at-end-of-line set to
> t, I notice a significant slowdown when moving the cursor up and down.
> 
> After digging a bit, the issue seems to come from a high number of
> overlays with the box face property (as flymake generates them). When I 
> change
> the face to remove the box property, I don't notice any slowdown. It is
> also possible that the slowdown mainly happens where there are multiple
> boxes on the same line (due to multiple warnings from flymake on the
> same line).
> 
> I used to profiler and saw a high CPU usage from redisplay_internal.
> 
> Tested on both pure-gtk and Xorg emacs, the slowdown happens in both
> cases.
> 
> I hope that my explanation is clear enough to give some hints on where
> to look for a fix.

Thanks, but I'm not sure what kind of fix could be found here.
Massive usage of the box face is indeed expected to make redisplay
more expensive, because the display engine needs to find where the box
face starts and ends, and that requires additional scans of the buffer
text.

Sorry.