wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
18.06k stars 807 forks source link

High CPU Usage when using software rendering #1735

Open viandika opened 2 years ago

viandika commented 2 years ago

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

wez commented 2 years ago

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 commented 2 years ago

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

viandika commented 2 years ago

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.