brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.24k stars 620 forks source link

Conky degrades performance of the whole window manager if own_window is too wide #1078

Closed tgbugs closed 7 months ago

tgbugs commented 3 years ago

Issue

Conky causes a massive slowdown hitting quadratic behavior when the window created by own_window = true is too wide. The quadratic behavior seems to be based on the total area of the window being rendered once a threshold in the width of the window is crossed.

This behavior effectively causes the whole window manager to lag for long periods of time when running without a compositor, or when running with a compositor the result is that the window manager will hitch every time the conky window is redrawn.

As a point of amusement/horror. This issue in combination with an asterisk in an unquoted bash ${VAR} and having many files in ${HOME} (the runtime path for conky) turns out to have been the root cause of the last 8 months (to the day) of my life being filled with the creeping insanity that initially a slack window with a new notification, and eventually any window with an * in the title would immediately cause my whole system to start lagging uncontrollably. The problem would go away when I cleared files out of ${HOME} only to return, apparently at random, but now in retrospect it was when enough new files accumulated to trigger this behavior in conky.

Information

Linux 5.11.6-gentoo x86_64 Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz GenuineIntel GNU/Linux

conky 1.12.1 compiled 2021-03-19 for Linux x86_64

The config below should be sufficint to tigger the issue, in the event that it does not, it may be due to some difference in the size of the virtual desktop. The xrandr output for my setup is.

Screen 0: minimum 8 x 8, current 3120 x 1920, maximum 16384 x 16384
DVI-D-0 connected primary 1920x1080+1200+370 (normal left inverted right x axis y axis) 531mm x 299mm
DP-1 connected 1200x1920+0+0 left (normal left inverted right x axis y axis) 518mm x 324mm

The xft font and verdana:size=7 are used to cause a strong non-linearity in performance when crossing from 5456 to 5457 in the padding below. The behavior can be reproduced using the default font.

conky.config = {
    background = false,
    double_buffer = true,
    --xinerama_head = 1, -- this is required if xinerama is enabled
    own_window = true,
    own_window_type = 'override', -- desktop also causes the issue
    update_interval = 0.1,
    use_xft = true, -- only need for font width see note
    font = 'verdana:size=7', -- only needed for exact width
}

conky.text = [[
hello quadratic render time if my window is just ever so slightly too wide
#${exec for _ in {1..1}; do echo; done}
#${exec for _ in {1..2}; do echo; done}
#${exec for _ in {1..3}; do echo; done}
#${exec for _ in {1..4}; do echo; done}
#${exec for _ in {1..5}; do echo; done}
${exec for _ in {1..10}; do echo; done}

# the trailing ${font} command is required to set this off
# AND it must be on the same line as the voffset
${voffset -1650}${font}
#${exec echo a | awk '{printf "%5456s", $1}'}
${exec echo a | awk '{printf "%5457s", $1}'}
]]
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

tgbugs commented 1 year ago

To my knowledge this is still a bug that has not been resolved.

tgbugs commented 1 year ago

Yep. Just confirmed that it is still happening on conky 1.13.1 compiled 2022-11-20 for Linux x86_64. Note to self: can check with conky -c ~/.conkyrc-example.

brndnmtthws commented 1 year ago

This sounds super annoying, I will see if I can figure out what's going on.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.

github-actions[bot] commented 7 months ago

This issue was closed because it has been stalled for 30 days with no activity.

tgbugs commented 7 months ago

This is likely still and issue and should probably remain open.