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: Sat, 29 May 2021 23:03:52 +0300

> 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?

> > > 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.



reply via email to

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