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: Aaron Jensen
Subject: Re: macOS metal rendering engine in mac port
Date: Sat, 29 May 2021 14:03:08 -0700

On Sat, May 29, 2021 at 1:03 PM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Aaron Jensen <aaronjensen@gmail.com>
> > Date: Sat, 29 May 2021 12:30:49 -0700
> > Cc: Alan Third <alan@idiocy.org>, emacs-devel@gnu.org
> >
> > > OK, but still: assq_no_quit should be very fast.
> >
> > Sure, it's fast when you call it once, but it's not being called once.
> > It's being called enough times that it adds 10ms to every key press
> > when I have line numbers on and 1000+ faces.
>
> In a 64-bit optimized build, assq_no_quit's loop body is just 10
> machine instructions.  With 1200 faces, searching all of them once
> should take something like 500 nanoseconds, i.e. 0.5 microsecond.
> Does this match the times you see and the number of times the function
> is called?
>
> 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

So yeah, that about accounts for 10ms

> > > > My theme is set up like this:
> > > > https://github.com/aaronjensen/nano-emacs/blob/master/nano-theme.el
> > >
> > > 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.



reply via email to

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