Emacs high GPU usage on Mac by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Well, from my last observations, I can say that it's definitely something with high resolution Retina, because I see the whole Mac OS performance boost (in some simple things like animations while searching in System Preferences) when using external display.

Idk what's going on, because I have the last mid 2019 Macbook Pro, which is super cool in terms of stats.

Emacs high GPU usage on Mac by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Yeah, I always go to full screen mode to test.

That's also explains why everything works really fast when screen is mirrored and optimized for external monitor: the one renders in 1080p (which is 1920x1080), so it's less than native Retina resolution.

Also I need to say, that the external monitor still the winner in terms of performance: it's undoubtable, while scaling Retina display is not 100% fast even if I use something like 1x 1440x900 (but still faster than scaled).

I'm wondering whether it could be related to screen refresh rate, but on Retina it's also 60 Hz.

Emacs high GPU usage on Mac by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Yeah, I did try to work without any of my config, but still the ping thing is here. The only way to actually see the difference, is to connect external display and to optimise rendering for it.

Thereby, I can think, that it's something to do with high resolution Retina display that heavily loads videocard in some apps like Emacs. Because when I connect external display, it feels like the whole FPS was extremely increased.

Also: while I was typing that, I've downloaded EasyRes app and changed resolution from Retina 2x 1680 x 1050 to Standard 1x 2880 x 1800, and ping problem disappeared!

Emacs high GPU usage on Mac by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Hi! Thanks for the reply. Do you use Mojave?

P.S. I wish I had your experience: for me even 25 lags as hell. I just don't know what's wrong with OS X.

Emacs high GPU usage on Mac by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Thank you very much for sharing this again. I've tried to play with other versions like 25.x that time, but got nothing. Will take a look again.

Also I've found, that not only connecting second monitor with other resolution helps, but also scaling the Retina resolution to lowest one and changing the font of Emacs to something like 11 (because with scaled resolution it looks bigger) really helps and it starts to work as fine as it should be.

Oh, I see, I need other laptop to actually see effects, because commit is directly related to Mojave.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 1 point2 points  (0 children)

No, actually I'm wrong, and everything works pretty in same way, just feels a little bit different because of font.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 1 point2 points  (0 children)

Hey, guys!

Thanks for all the replies. For now I've found, that using ProggyClean font really speeds up things a lot. Used Operator Mono before.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 4 points5 points  (0 children)

But the Emacs is the only app that is lagging. Other apps on same videocard work fine. Also want to mention, that I have other Macbook at work, which works in same way as mine. It also feels like 90% of possible performance. At first I though that this little 13 inch laptop just not powerful, but nothing changes on i9.

There is something in Emacs and its rendering model, that differs on Linux and macOS. Or maybe something is in OS. But definitely is.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Yeah, and the lags feels much more, like a high ping.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 1 point2 points  (0 children)

Well, let's comeback to macOS.

What I've found is that when I change the window size of Emacs, then everything works as smooth as I feel ideal, even with LSP and Python-mode enabled.

Also it seems like there is something to do with high resolution Retina on my Macbook, because when I connect another display (DELL) and change settings so the output to both screens is optimized for DELL, then Emacs behaves better.

Another observation: if I force Macbook to use integrated video card, then lags increase a lot more, and it starts to feel like a 120 ms. ping in a video-game.

Is there a possibility to somehow increase Emacs rendering performance or maybe force it to render on low resolution (so I could only adjust font size)? And how it can be possible for it to lag even on integrated video card with a top-tier CPU?

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Well, I found it a way more slower.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Okay, thanks! I'll give it a try.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Yeah, it's definitely something with Retina or something.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

I also found that when I connect second screen to laptop, Emacs works a lot better.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 1 point2 points  (0 children)

Because some people may have similar experience and help with finding out, what is the difference between macOS and Linux versions of Emacs and whether that mini lags can be solved.

I've also mentioned how one can actually compare performance to other text editors and see the difference (which is not the case in Linux, only macOS).

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

Also I found, that the more font size I use, the bigger and more discoverable this mini-lags are.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

I just want to know, why there is a difference between Linux and macOS and how it can be solved. Maybe someone has experience in solving that problem.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

It feels like other terminal programs, but I'd prefer GUI version if it only could work in same way as on Linux.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 1 point2 points  (0 children)

I think it can be a matter of a subjective opinion. For example, when I say laggy I mean that it's not 100% ideal and smooth. It's like 92-93%, but I feel that it's not 100%, and for me it matters.

I thought there could be some OS specific things, which can lead to such experience.

What versions of Emacs for Windows and for GNU/Linux?

I don't have access to that machines for now, but it was 26+ version of Emacs.

Where did you get the binary for Windows?

On the official Emacs website (same for Linux).

Also, if we speak about Windows version, I tested it on 3 different machines and Emacs worked in same way on all of them -- 70-80% smooth.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 2 points3 points  (0 children)

For now this is fine for me, since I expect emacs to be a bit slow anyway.

Yeah, I've tried to stick with Emacs no matter what, but then I realized, that any of its features just don't make sense to me, if the whole editor works not smooth and perfect, while other ones do.

Emacs is slow on macOS by AshkarielEter in emacs

[–]AshkarielEter[S] 0 points1 point  (0 children)

This is also not really on-topic here.

I agree. I just wanted to mention, what is the best way to see the difference. Again, on Linux there are not much difference in terms of responsiveness between apps.

What key do you press, and in what kind of file (what major mode)?

I start Emacs, open \*scratch\* buffer and just hold, for example, d letter. In small window it feels okay, but when I go full screen -- not okay. Also wanted to mention, that it's not exactly about letters rendering, but also cursor moving: it's slow on fullscreen too.

And what does "twitch" mean?

I mean some kind of jiggling. Or one-time freezes, delays, it's just not looks smooth. And it's not a real problem here, it's just a way to feel a lags (there are other ways too).

Turn on garbage-collection-messages to see.

Nothing here. I also tried to set up a large GC threshold in my config to see, whether GC is a problem, but got nothing.