Subject: bug#71454: 30.0.50; Performance issues with font selection

From: Gerd Möllmann <[email-masked]>
Date: Mon, 10 Jun 2024 18:42:35 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Kai Ma <[email-masked]>
>> Date: Mon, 10 Jun 2024 14:35:50 +0200
>> Cc: Jeremy Bryant <[email-masked]>,
>>  [email-masked]
>> 
>> 
>> 
>> > On Jun 10, 2024, at 13:55, Eli Zaretskii <[email-masked]> wrote:
>> > 
>> >> Cc: [email-masked]
>> >> From: Kai Ma <[email-masked]>
>> >> Date: Mon, 10 Jun 2024 00:17:55 +0200
>> >> 
>> >> 
>> >>> On Jun 10, 2024, at 00:10, Jeremy Bryant <[email-masked]> wrote:
>> >>> 
>> >>> Would you be able to provide a self-contained series of steps starting
>> >>> from emacs -Q?
>> >> 
>> >> On my machine it is extremely easy to reproduce by simply:
>> >> 
>> >> 1. emacs -Q
>> >> 2. Switch to *scratch*
>> >> 3. Copy the provided text into *scratch*
>> >> 4. Emacs will freeze for 17 seconds or so, and it cannot be interrupted by C-g
>> > 
>> > I cannot reproduce this, I get an almost instantaneous redisplay with
>> > those characters.
>> > 
>> > When your Emacs eventually displays the text, how many characters are
>> > shown as boxes with hex code, and which ones are those?
>> 
>> None are hex code here. They eventually get displayed, but it takes a long time.
>
> Then it definitely sounds like macOS specific.  Does anyone know how
> Emacs on macOS searches for fonts, and whether there are any
> font-caching facilities, either in Emacs or by the OS?

Don't know, but the display of the strings mentioned is instantaneous
here too (macOS 14.5), with (length (font-family-list)) == 281.

Maybe use the Font Book app and see if the fonts are all valid? (Start
Font Book, choose All Fonts, select them all with Command + A, then
context menu on the selectoin and choose Validate.)