reddit / emacs

Awful performance with PGTK on Wayland?

markasoftware · 2022-04-27 04:13
I tried out PGTK on the master branch to see how native wayland is coming along, but was very disappointed. There's extreme lag when moving the mouse around between items in dashboard-mode (they're supposed to be highlighted when hovering over them, but this highlighting is laggy), and my CPU usage spikes when i move the cursor around a lot (eg, by holding down an arrow key) in a buffer. Does this happen to everyone? I am also using native compilation.
s-kostyaev · 2022-04-27 05:29
> Does this happen to everyone? No, it's just you. I have the same setup and all works perfectly fine. Try to profile your Emacs. Also, does this lags happen on `emacs -Q`? P. S. Emacs 29 + pgtk + native compilation on Gnome Wayland.
Erich_Zann21 · 2022-04-27 08:04
I've kinda experienced the same when using Emacs on 4k displays in particularly big frames(larger than half of the screen, typically), especially so with Emacs configs laden with plugins such as Doom Emacs, where the performance degradation is tangible. It might just be my impression, but I've noticed that pgtk Emacs is much more susceptible to higher resolutions than Emacs with other toolkits.
JohnDoe365 · 2022-04-27 10:41
Is this general or specific to (a) certain mode(s)? If you can share a file, people can help you out. Having said that, because of HiDPI monitor fractional scaling is a must for me and I have no such issues with PGTK on Gnome (using 28.50)
markasoftware · 2022-04-27 14:48
Interesting. In my case, though, it's just 1920x1080.
markasoftware · 2022-04-27 14:54
I just tried with `emacs -Q` and holding down an arrow key to move the cursor over text still causes emacs to spike to about ~~100% CPU usage on one core~~ actually it's more like 15%, but still much more than with X, where it's almost zero. And dashboard performance is still bad. I am using KDE wayland. But it's emacs, not kwin, that's consuming most of the CPU moving the cursor.
markasoftware · 2022-04-27 14:54
The problem occurs in all modes I tried, and even with `emacs -Q`. Holding down an arrow key causes CPU usage to spike to 100% on one core.
capfredf · 2022-04-27 15:30
I have been using my own builds of emacs with PGTK + Native compilation for almost a year on Wayland, but I haven't running into any performance issues so far. I think you might want to report this bug via `report-emacs-bug` and see if developers can help troubleshoot and/or fix your issue
chmouelb · 2022-04-27 16:21
I had the same thing and tracked it down to this package https://www.reddit.com/r/emacs/comments/rnnic3/goodscroll_package_on_wayland_with_pgtk_seems_to/ your mileage may vary....
markasoftware · 2022-04-27 18:29
I am not using good-scroll; the issue persists (though it's less severe) when I disable all sorts of smooth scrolling.
[deleted] · 2022-04-28 02:59
[deleted]
bezirg · 2022-04-28 06:22
I have to agree here. In big displays example 4k, i have the same noticeable input latency lag. I am using sway btw, if that matters. Everything fine on 1080p though.
sebhoagie · 2022-04-28 12:05
pgtk is only in 29 It's the only thing holding me on master...
[deleted] · 2022-06-06 15:30
[deleted]
pltanton · 2022-06-06 15:32
Experiencing same issue? Is there still no solution?
NewCriticism9256 · 2022-09-10 07:13
u/pltanton do you have `set-frame-parameter` in your config by any chance? Removing that fixed it for me. ;; (set-frame-parameter (selected-frame)'alpha '(92 . 92)) ;; (add-to-list 'default-frame-alist'(alpha . (92 . 92)))
LeonardoZarkli · 2022-12-24 02:23
It works for me! Thanks, bro. Non-transparent window isn't a problem to me.