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.devel Subject: Re: macOS metal rendering engine in mac port Date: Sun, 30 May 2021 09:22:10 +0300 Message-ID: <83tumk4u7h.fsf@gnu.org> References: <83k0ni6pje.fsf@gnu.org> <83eedq6mvm.fsf@gnu.org> <83zgwd6gk3.fsf@gnu.org> <83bl8t5vu6.fsf@gnu.org> <83a6od5tqh.fsf@gnu.org> <834kel5qp3.fsf@gnu.org> <83zgwd489j.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28517"; mail-complaints-to="usenet@ciao.gmane.io" Cc: alan@idiocy.org, emacs-devel@gnu.org To: Aaron Jensen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 30 08:23:07 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lnEqp-0007BZ-J9 for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 08:23:07 +0200 Original-Received: from localhost ([::1]:51910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnEqo-0006wt-6c for ged-emacs-devel@m.gmane-mx.org; Sun, 30 May 2021 02:23:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnEpp-0006G4-OZ for emacs-devel@gnu.org; Sun, 30 May 2021 02:22:05 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34092) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lnEpl-0000Mm-Us; Sun, 30 May 2021 02:22:04 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:1366 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lnEpl-0005SH-He; Sun, 30 May 2021 02:22:01 -0400 In-Reply-To: (message from Aaron Jensen on Sat, 29 May 2021 14:03:08 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:270113 Archived-At: > From: Aaron Jensen > Date: Sat, 29 May 2021 14:03:08 -0700 > Cc: Alan Third , emacs-devel@gnu.org > > > Also, please note that typing a single character redisplays just one > > line, the one where point is. That perhaps needs to merge 4 or 5 > > faces. So I'm not sure how come this could add 10ms to every > > keypress: you'd need 20,000 calls of assq_no_quit to account for 10ms. > > How come we call assq_no_quit 20k times when processing insertion of a > > single character? > > So with a single keypress I see: > > 6,000 lface_from_face_name_no_resolve > 19,000 assq_no_quit In "emacs -Q" I get only about 180 calls to lface_from_face_name_no_resolve when I type a single character, depending on where in xdisp.c I do that. How many calls do you see when you just move the cursor to the left or to the right one character position? > > > > I see a lot of :inherit there. I'm quite sure this exacerbates the > > > > problem, as each :inherit needs to recursively search for and access > > > > the attributes of the parent face. > > > > > > It only navigates the parent when the face matches, yes? > > > > Which face matches what? > > > > Emacs needs to access the parent face each time it merges the > > inheriting face with another one, because it needs to resolve all the > > attributes of each face it merges. > > Sorry, I mean having 900 new faces with inherits shouldn't change the > time it takes to merge faces for a single face. In other words, > inherit only adds instructions when the face being merged has > inherits. It doesn't add it when 900 not-being-merged faces have > inherits. But in your case, it looks like every face inherits. So each time Emacs finds the face it needs to merge by looking in frame's face alist, it then needs to look again to find the parent of that face.