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

Background (color or image) noticeably affects performance on slower GPU's #6821

Closed
ghost opened this issue Feb 6, 2022 · 11 comments
Closed
Labels
bug Not working as intended

Comments

@ghost
Copy link

ghost commented Feb 6, 2022

  • Sway Version:

    • sway version 1.8-dev-30d27b59 (Feb 5 2022, branch 'master')
  • Debug Log:

  • Configuration File:

    • default configuration
  • Description:

It's probably clearly reproducible only on low-end GPU's and high resolution screens. I noticed this issue when scrolling in Firefox was not smooth on some pages, when it should (and it is w/o background color or wallpaper). Not reproducible in full-screen.

Step to reproduce:

  • set fixed, lowest GPU clocks, if possible
  • comment out output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill
  • run sway
  • run glmark2-wayland -b build --run-forever --size 1800x1800 for example. (Link to glmark2)
  • after few loops run swaybg -o "*" -c '#000000' -m solid_color

Reproducible results on my system:

W/o any background:

[build] <default>: FPS: 2959 FrameTime: 0.338 ms
[build] <default>: FPS: 2954 FrameTime: 0.339 ms
[build] <default>: FPS: 2950 FrameTime: 0.339 ms
[build] <default>: FPS: 2965 FrameTime: 0.337 ms

After swaybg -o "*" -c '#000000' -m solid_color

[build] <default>: FPS: 2672 FrameTime: 0.374 ms
[build] <default>: FPS: 2659 FrameTime: 0.376 ms
[build] <default>: FPS: 2665 FrameTime: 0.375 ms
[build] <default>: FPS: 2661 FrameTime: 0.376 ms
[build] <default>: FPS: 2664 FrameTime: 0.375 ms
[build] <default>: FPS: 2668 FrameTime: 0.375 ms
@ghost ghost added the bug Not working as intended label Feb 6, 2022
@ghost ghost changed the title Background (color or image) noticeable affects performance on slower GPU's Background (color or image) noticeably affects performance on slower GPU's Feb 6, 2022
@effae
Copy link

effae commented Feb 17, 2022

I've been scratching my head as to why my mouse movement has felt somewhat sluggish over the past weeks, as if I'd suddenly ran into some performance issue which would've resulted in poor fps.. Thank you for opening this issue; I commented out output * bg #313443 solid_color in my config, and the issue is gone!

I'm running sway on an old(ish) thinkpad t450s (Intel(R) Core(TM) i5-5200U CPU, 12 GB ram) with a GeForce 940M dGPU which is switched off with bbswitch.

sway version 1.8-dev-f707f583 (Feb 10 2022, branch 'master')

@emersion
Copy link
Member

Is this a regression? Was it working better with a previous version of Sway/wlroots?

@ghost
Copy link
Author

ghost commented Feb 18, 2022

Is this a regression?

If it is, it's not a recent regression. It's reproducible in sway 1.6 and wlroots 0.13

@danieldg
Copy link
Contributor

FYI: If it's not a regression, this may be because sway renders each layer for every frame (so it'd normally paint grey, background, window), and not rendering the background will be slightly faster. This is required if surfaces use transparency, and currently the only time it's skipped is for opaque overlays (like lockscreen) or fullscreen.

@ghost
Copy link
Author

ghost commented Mar 12, 2022

@danieldg Thank you for the explanation. This is most likely it. So it's probably related to #5723

As a side note, it is worth mentioning that even in full screen, wlroots/sway is not on pair with other wayland compositors. It this a known issue?



glmark2-wayland -b build --run-forever --size 2000x2000 (floating)

sway-git/wlroots-git mutter 41.4 standalone weston 10
default (radial gradient on mutter, wallpaper on weston) - ~2740 fps ~2743 fps
grey ~2495 fps - -
+ background ~2200 fps - -
+ background + terminal window behind ~1899 fps - -




glmark2-wayland -b build --run-forever --fullscreen (4K)

sway-git/wlroots-git mutter 41.4 standalone weston 10
default (radial gradient on mutter, wallpaper on weston) - ~2098 fps ~2100 fps
grey ~1690 fps - -
+ background ~1690 fps - -
+ background + terminal window behind ~1690 fps - -

@emersion
Copy link
Member

@ghost
Copy link
Author

ghost commented Mar 14, 2022

https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3488 should help when combined with #6844

Just tested it. Noticed some visual glitches, but it works. Thanks!

@Xyene
Copy link
Member

Xyene commented Mar 14, 2022

If you noticed visual glitches with #6844, please report them in that PR.

@Nefsen402
Copy link
Member

Nefsen402 commented Sep 6, 2022

With scene optimizations merged with upstream wlroots, it would be nice to know if they improve this. With #6844 I have frame time consistency improvements with my laptop, it would be nice to have independent validation.

@ghost
Copy link
Author

ghost commented Sep 6, 2022

Absolutely. #6844 also fixes the other performance issue I mentioned above. Amazing work, @Nefsen402. Thank you!

sway-git/wlroots-git w/#6844
grey/black ~2495 fps ~2750 fps
+ background ~2200 fps ~2750 fps

@vyivel
Copy link
Member

vyivel commented Jan 18, 2024

Closed by #6844.

@vyivel vyivel closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

6 participants