wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

High CPU Usage when using software rendering

Open viandika opened this issue 3 years ago • 3 comments

What Operating System(s) are you seeing this problem on?

Linux X11

WezTerm version

wezterm 20220318-192454-4007ccbc

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Whenever I open Wezterm and notice that typing is a bit sluggish. When I check on htop, the minimum cpu usage by wezterm is 40% even on idle and rises occasionally to 100% on use. Although, the cpu usage does go back to 0% when its not in focus.

I am using a 4-core ARM64 CPU so i pulled from github and followed the docs to built from source. For comparison, xfce-terminal and alacritty uses less than 1% cpu usage.

To Reproduce

No response

Configuration

font = wezterm.font("FiraCode NF"),
default_cursor_style = "BlinkingBar",
cursor_blink_rate = 500,
window_padding = {
	left = 0,
	right = 0,
	top = 0,
	bottom = 0,
},

Expected Behavior

No response

Logs

log.txt

Anything else?

No response

viandika avatar Mar 19 '22 16:03 viandika

You're running with a CPU based renderer, which has a hard time rendering the smoothly eased blink animation. I would suggest setting animation_fps = 1 so that wezterm uses simpler blinking.

wez avatar Mar 19 '22 17:03 wez

I added some docs for this here: https://wezfurlong.org/wezterm/config/lua/config/animation_fps.html

wez avatar Mar 19 '22 20:03 wez

Thanks. That help with CPU usage on idle. But when there is text changing on the screen (e.g. I just open htop) the CPU goes up to 35-45% whereas in alacritty it is using up 5-15%. Also, scrolling in neovim is very laggy that the cursor would jump lines instead of going down/up line by line.

viandika avatar Mar 20 '22 02:03 viandika