emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: macOS metal rendering engine in mac port


From: Eli Zaretskii
Subject: Re: macOS metal rendering engine in mac port
Date: Sun, 30 May 2021 09:22:10 +0300

> From: Aaron Jensen <aaronjensen@gmail.com>
> Date: Sat, 29 May 2021 14:03:08 -0700
> Cc: Alan Third <alan@idiocy.org>, 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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]