swww icon indicating copy to clipboard operation
swww copied to clipboard

Animated backgrounds causes sway to use nontrivial CPU

Open deifactor opened this issue 1 year ago • 1 comments

Displaying a 4K webp using swww causes the sway process itself to use about 10 times as much load as it does when displaying the original mp4 using mpv (or mpvpaper). I'm guessing that it has to do with the way swww uses wl_shm.

(It also might be just inherent to using shm for animations instead of directly using a GPU buffer; I have vague memories where even continually reusing the same wl_shm buffer would result in large animations using a lot of CPU.)

deifactor avatar Sep 26 '24 07:09 deifactor

If you are playing a "normal" video, then this is expected. swww was specifically optimized to deal with animations that do not change a lot frame to frame. If you want to play something more complex, then I would recommend going for mpvpaper.

LGFae avatar Sep 26 '24 11:09 LGFae

This should have improved significantly in the latest released version, since we no longer use any multi-threading. At most, it will saturate one CPU thread. So I will closing this. Note that the fact that swww is not designed to work with standard mp4 files remains true.

LGFae avatar May 25 '25 18:05 LGFae