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: Tue, 25 May 2021 08:35:42 -0700

On Tue, May 25, 2021 at 5:16 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Aaron Jensen <aaronjensen@gmail.com>
> > Date: Mon, 24 May 2021 23:26:37 -0700
> > Cc: emacs-devel@gnu.org, Alan Third <alan@idiocy.org>,
> >       YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
> >
> > > > Alan, I could understand why drawing glyphs would take longer (there's
> > > > more to draw when there are line numbers),
> > >
> > > ??? Because line numbers add ~3 glyphs to each line?  How can this 
> > > explain any significant slowdown?  Do you see something similar if you 
> > > add 3 characters to every line and benchmark the scroll?
> >
> > I added 3 characters to the end of every line of xdisp.c (//1) and it
> > went from 7.2s to 8.4s -- 17% (emacs -Q, no line numbers).
>
> The 17% is about twice what I'd expect, since adding 3 characters to
> each line of xdisp.c enlarges its text by only 9.3%.

Pure guess here, but it's also making a lot of empty lines non-empty
(14% more). Perhaps that has an added cost somehow?

> > The timing differences are primarily in display_line. gui_write_glyphs
> > is 15% slower, which is nowhere near 576ms. Profile attached.
> >
> > That certainly doesn't match the 78% slower for drawing glyphs in the
> > line number scenario.
> >
> > Any suggestions on what to try next?
>
> The numbers are so against my intuition that I'm not even sure in
> which direction to think...
>
> How did you compile Emacs? which compiler and what compiler and linker
> switches?  And what kind of CPU do you have there?  I'm looking for
> something that could explain why parts of code that should take like
> 20% of the total redisplay time are so dominant in your case.

clang, with -O2. Specifically these configure flags:

CFLAGS="-g3 -O2" \
--disable-silent-rules \
--with-xml2 \
--with-gnutls \
--without-dbus \
--with-imagemagick \
--with-modules \
--with-rsvg \
--with-ns \
--disable-ns-self-contained


This CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz

>
> Alan, do you see similar numbers (in percents) to what Aaron reports?
> Or is that something peculiar to his system?

What I get depends on frame size and whether or not I'm using
nativecomp or Alan's branch or master. I just a test with a smaller
frame size (on Alan's branch this time, just happens to be what I have
built) and saw 5.58 vs 6.8s: 22%. But then I ran the bench again w/
line numbers and couldn't get it below 7.2s, so there's quite a bit of
variability in the test runs.

Alan, I haven't forgotten about your question about latency and that
additional patch. I'm using that patch now and will work with it
through the day.



reply via email to

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