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: Alan Third
Subject: Re: macOS metal rendering engine in mac port
Date: Sat, 22 May 2021 19:44:58 +0100

On Fri, May 21, 2021 at 04:02:07PM -0700, Aaron Jensen wrote:
> On Fri, May 21, 2021 at 10:39 AM Alan Third <alan@idiocy.org> wrote:
> >
> > Yes, and I don't think you need to do anything special with
> > optimisation levels.
> >
> > Load instruments.app, choose "time profiler", then at the top select
> > emacs and hit the record button. Do whatever you do, then hit the stop
> > button, and the window below should give some indication of where it
> > is spending the most time. I was thinking that it would be in the copy
> > from one surface to the other, but I profiled my own build and it
> > appears to be negligible. OTOH, since your surfaces are much bigger
> > that might be it.
> >
> > I've tried reducing the amount of times the NS port updates the
> > screen, although I don't think I've really been very successful, but
> > you may as well give it a go and see if it makes any difference.
> > Please try the scratch/ns/surface-stuff branch.
> 
> I got 378 characters on this branch, which is a little faster.
> I should also note that on Emacs 27 NS I get 578 characters, which is
> slightly faster than Emacs mac port.

On my machine the scroll benchmark shows Emacs 27 being able to update
the screen more than twice as fast as any version of the Mac port, yet
this shows Emacs 27 isn't really any better.

Perhaps they both reach the maximum input rate?

Or the NS port's event handling is slow, which is quite possible as
it's single threaded and I think the Mac port uses a separate thread
for toolkit stuff. (Someone please correct me if I'm wrong.)

IIRC you said that you still thought input in Emacs 27 feels sluggish?

> I've attached a couple profiles of the surface stuff branch.

It turns out I can't open these because my version of xcode is too
old... Although I think it's the most recent I can use on this
machine.

> Of note is that display-line-number-mode seems to be a massive
> culprit in slowing this down. Turning that off about gives me about
> 50% more performance.

Does it give a similar slowdown in the Mac port?

> The rest of what takes time appears to be mem copies, which makes
> sense that that would scale w/ screen size.

If someone wanted to send me a 5k screen, debugging this would be a
lot easier. ;)
-- 
Alan Third



reply via email to

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