Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI is very slow with a high resolution/refresh rate monitor #715

Open
KSPAtlas opened this issue Jan 23, 2025 · 9 comments
Open

UI is very slow with a high resolution/refresh rate monitor #715

KSPAtlas opened this issue Jan 23, 2025 · 9 comments

Comments

@KSPAtlas
Copy link

I've been trying to use DrRacket, but the UI is significantly slower than most other programs, especially when filling the entire screen (decreasing the size of the DrRacket window helps a little, but it's still slow).

Actions like switching tabs can take seconds, in which the program is completely unresponsive.

  • Resolution: 3440 x 1440 (WQHD)
  • Refresh rate: 180 Hz
  • Linux distribution: NixOS (used DrRacket from the nix package)
  • Windowing protocol: Wayland
  • Window manager: Sway
  • Graphics card: NVIDIA GTX 1650 (Proprietary drivers, open kernel modules)
@LiberalArtist
Copy link
Contributor

My guess is that the part of your configuration most different from what other people use is the 180 Hz refresh rate. (FWIW, my laptop is 3840x2400@60Hz on an Intel card, running KWin/Wayland on Debian Bookworm with DrRacket from the Guix package.)

Are you able to try a lower refresh rate temporarily and see if the problem persists?

Do you have HiDPI scaling on your display, and, if so, is it 200% or something fractional?

Another thing to note is that racket/gui still uses GTK 3. It's possible there's some improvement in GTK 4 that we don't have. Do you have similar problems with any other applications?

@KSPAtlas
Copy link
Author

KSPAtlas commented Jan 25, 2025

No, I don't use any form of HiDPI scaling.

Switching to 60Hz has no effect on the GUI performance. The GUI performs fine when it's not doing tasks like opening tabs, windows etc, but when it is the entire GUI locks up (including stuff like hover-over animations) until the task is done. Also no, I don't have problems like this with other applications

@rfindler
Copy link
Member

Would it be possible for you to make a short movie to show us what you mean exactly? It is known that when the window is large (and the file isn't short) that scrolling (and some other editing operations) are slow. But that would go away when you made the window smaller, so there may be some other, simpler problem here too.

@KSPAtlas
Copy link
Author

KSPAtlas commented Jan 29, 2025

@rfindler Whoops, never noticed your reply, here's a video that I took when it happened but ended up not sending

S7AkgRZ.mp4

@KSPAtlas
Copy link
Author

Here's a trace from DrRacket where I was doing similar things to the video:

Sa8qvD4.png

@rfindler
Copy link
Member

Thanks; it does seem to be something slow at the wx layer (or in the GUI system of the platform) somehow. Can you share the entire profile, instead of just a screenshot of the start of it. (Just looking at what's here, I don't see anything that actually takes time, just things that'll tend to be on the top of the stack.)

Also, can you share what you did to get that profile?

@KSPAtlas
Copy link
Author

KSPAtlas commented Feb 6, 2025

@rfindler The command I used was PLTDRPROFILE=1 drracket, and I've attached another profile I did (note that I changed desktop environments, but this is also reproducible on COSMIC)

racket.log

@rfindler
Copy link
Member

rfindler commented Feb 9, 2025

Thanks for the complete log! (Thanks also to @mflatt for detective help here.)

It looks like a problem is that do-on-paint is called 6353 times. Those callbacks originate in either the "expose-event" or the "draw" callback. Maybe we can see what's going on if you were to add a printf into those two to figure out which one is getting called so many times?

@mflatt
Copy link
Member

mflatt commented Feb 9, 2025

One more thought: Does it matter whether you're using a tiling window manager like Sway or something else? One possibility is that the Racket GUI toolkit is fighting with the window manager over a window's size, and that keeps triggering refreshes. I don't see that effect when I try Sway myself, but it would be good to rule it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants