Subject: Re: bug#77361: [PATCH] New user option to hide minor mode lighters

From: Daniel Mendler <[email-masked]>
Date: Sun, 06 Apr 2025 10:40:32 +0200

Pengji Zhang <[email-masked]> writes:

> Daniel Mendler <[email-masked]> writes:
>
>> Hello Pengji!
>
> Hi Daniel!
>
>> This is a good idea. I've used both minions and diminish and it is nice
>> to have this functionality ootb. I have some concerns however regarding
>> the frequent mode line recomputation during redisplay. Do you see a
>> possibility to cache the computed minor mode menu and collapsed lighter?
>> In any case, the computation should be as efficient as possible. For
>> profiling I suggest to enable your new user option and then scroll
>> repeatedly in order to force redisplays and mode line recomputations. If
>> certain mode line functions appear prominently in the profile they are
>> candidates for optimization, in order to reduce redisplay latency.
>
> Thanks! I did not consider the performance issue much. How about
> deferring the computation of the minor mode menu, the most costly part?

Deferring the menu computation sounds like a good idea, in particular
since the menu is only accessed rarely. The repeated recomputation of
the mode line elements itself should be fine.

> Still we need to split 'minor-mode-alist' and do some other work, but my
> profiling showed that there was little impact to the performance.

Thanks for checking.

Daniel