From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#71454: 30.0.50; Performance issues with font selection Date: Fri, 27 Sep 2024 13:29:13 +0300 Message-ID: <86o7498k5i.fsf@gnu.org> References: <22612F93-FC37-48E8-8137-E9FF6F5B3A0D@gmail.com> <86y13d8v3h.fsf@gnu.org> <88D40848-CC43-4397-81EA-4BBB4B2EAC30@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19994"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, gerd.moellmann@gmail.com, alan@idiocy.org, 71454@debbugs.gnu.org To: Kai Ma Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 27 12:29:56 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1su8EV-00052w-Ph for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Sep 2024 12:29:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1su8EB-0008Sa-HI; Fri, 27 Sep 2024 06:29:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su8EA-0008SP-8Q for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 06:29:34 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1su8E9-0001x7-VA for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 06:29:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=nuiLzZJ1hHUpT1FLwFxOq6OiusvrDDa6s8rRcRzXk6g=; b=g9uLHoxbkvXqV0qPEZBfQkYf5F2VwSbgCYuM4ZEve3qDts6qLd3x9NPc93wV2eVTfHO3DQUtdZWq5AGhjH2mmzoccJe7hh+qXbrrVx3peG0Pcw9DQSljdUqdWx0WTcULYbLFQ2yNMmWUuLwA+sDea5H3mEaT9pc5PtESdZxhuoojoHeq3ABs9A1Jgs8EIdA25Qo/9SABjDWL+Wblu5ZumTPyG4hWqyEIEbRaT/l0nEKt/TeyZUqfEY24uRlu7g7k0FoLoffZg+BhDGVY5R3TnEm9V5xFTDoC/oeLgHaimYhW21Xh7VcRqQZt4H95sQ04xeMcBflEd8rHhIsPw8rlDA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1su8Ec-0007sU-91 for bug-gnu-emacs@gnu.org; Fri, 27 Sep 2024 06:30:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Sep 2024 10:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71454 X-GNU-PR-Package: emacs Original-Received: via spool by 71454-submit@debbugs.gnu.org id=B71454.172743299330239 (code B ref 71454); Fri, 27 Sep 2024 10:30:02 +0000 Original-Received: (at 71454) by debbugs.gnu.org; 27 Sep 2024 10:29:53 +0000 Original-Received: from localhost ([127.0.0.1]:53745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1su8ES-0007rc-T4 for submit@debbugs.gnu.org; Fri, 27 Sep 2024 06:29:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:37090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1su8EQ-0007rD-NG for 71454@debbugs.gnu.org; Fri, 27 Sep 2024 06:29:51 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su8Dr-0001vi-Pd; Fri, 27 Sep 2024 06:29:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=nuiLzZJ1hHUpT1FLwFxOq6OiusvrDDa6s8rRcRzXk6g=; b=L0SatMfUeKjVZicVGR7J jnMX5pXwaa6lODzc0Y5w7gpwfkU1cHOEYOw1CJbHe1Da8j1HHfUy3yCsBWen9l5ykg/H1u2AHcZ3K cI3NI2iScQrhmNL+T2PwdJwoNc7D8Swmwht9SWPVzD28GFbG07UY8jF4b2c8dFGTmr5/e2ZLCmLBV 6G0/+crxjFCymE5pAlOd62MdtvnP2Z9k3gSs334uDW+tt1+Z8kM3h9oKKp7C7sWX66nlZTGFCulqb E1EyXWjk4yZhNISmrHl9Oqdxb3ikoLCdWfZY4PNOnxSiUk7uUj8q13FWp5kTfMHyswCje8P4cmlIN //zSeMyfaRxVYg==; In-Reply-To: <88D40848-CC43-4397-81EA-4BBB4B2EAC30@gmail.com> (message from Kai Ma on Fri, 27 Sep 2024 09:51:06 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292504 Archived-At: > From: Kai Ma > Date: Fri, 27 Sep 2024 09:51:06 +0200 > Cc: Alan Third , > Po Lu , > Gerd Möllmann , > 71454@debbugs.gnu.org > > This part, about _any_ unusual characters causing a significant delay, > seems to imply that the default fontset is not set up correctly on > your system (or maybe in general on macOS), or perhaps that the way > the fontsets are used on macOS is very different from other systems. > For starters, are the fonts that Emacs selects for the characters you > used for testing different from the fonts defined by fontset-default > for those characters? If so, what happens if you modify > fontset-default (using set-fontset-font) to specify for these > characters the same fonts as what Emacs selects with the default value > of fontset-default? does font selection become much faster (it > should)? > > Yes, if I manually set the font, it becomes instant. Thanks, so it means finding a font that matches the default font's spec is indeed slow on your system. I wonder if this is a general issue with macOS, or just with the version and/or configuration you are running. > It could also be the matter of selecting the default face's font. For > best results, it should be a font that covers many popular scripts, at > the very least Latin, Cyrillic, and Greek. Judging by the "unusual" > characters you show, it sounds like Latin characters are not well > covered by your default face's font? If so, perhaps choosing a font > with better coverage will make the situation better for you? > > It would not eliminate the problem though. I didn't mean that it will. However, being able to display more characters without delays is a Good Thing regardless. > Based on the profiling, my guess is that CTFontDescriptorCreateMatchingFontDescriptors is doing a linear > search internally (it probably didn’t just pick the specified by the font family?), so macfont_list is accidentally O > (n^2). This (if true) should explain why it’s so slow. Yes, you said that in your original report.