LGUG2Z / komorebi

A tiling window manager for Windows 🍉
https://lgug2z.github.io/komorebi/
Other
9.51k stars 191 forks source link

[BUG]: Maybe a perf issue (high CPU & fan speed) #862

Closed KevinNitroG closed 5 months ago

KevinNitroG commented 5 months ago

Describe the bug

I think the version 0.1.26 has a performance issue. I have noticed many times that after using komorebi for a while, my computer's fan goes up and my CPU is about higher + 3-5%. It will end up by restarting komorebi (komorebi stop and then komorebi start), and the issue comes back after using for a while again.

To Reproduce

Steps to reproduce the behavior:

  1. Use for a while (about > 30 mins)

Expected behaviour

No High CPU and Fan speed

Screenshots and Videos

In the video, we cannot see clearly the amount of CPU that komorebi took. But it affects my computer's CPU and Fan speed that I can feel it.

Video

Operating System

OS Name:                   Microsoft Windows 11 Home
OS Version:                10.0.22631 N/A Build 22631

komorebic check Output

KOMOREBI_CONFIG_HOME detected: C:\Users\kevinnitro\.config\komorebi

Looking for configuration files in C:\Users\kevinnitro\.config\komorebi

Found komorebi.json; this file can be passed to the start command with the --config flag

Found C:\Users\kevinnitro\.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag

Additional context

I use AHK. There are few more unrelated config, but I just want to let you know for a more details analysis. My full AHK script is:

#SingleInstance Force

SetTitleMatchMode 3
DetectHiddenWindows true

; #Warn All, Off

; # Left Win
; ^ Ctrl
; ! Alt
; + Shift

#Include "komorebi/komorebic.lib.ahk"

; --- CONFIG ---

#Backspace::try ControlSend "!{F4}",, "ahk_class Progman"
^#!r::Reload

; --- RUN APP VIA KEYBOARD SHORTCUT ---

#Enter::Run "wt.exe"
#t::Run "alacritty.exe"
#c::Run "code.exe"
#b::Run "chrome.exe"
#s::Run "C:\Users\kevinnitro\AppData\Roaming\Spotify\Spotify.exe"

; --- ALT TO SWITCH TAB IN BROWSER ---

GroupAdd "Browser", "ahk_exe arc.exe"
GroupAdd "Browser", "ahk_exe brave.exe"
GroupAdd "Browser", "ahk_exe chrome.exe"
GroupAdd "Browser", "ahk_exe chromium.exe"
GroupAdd "Browser", "ahk_exe edge.exe"
GroupAdd "Browser", "ahk_exe firefox.exe"
GroupAdd "Browser", "ahk_exe thorium.exe"

#HotIf WinActive("ahk_group Browser")

!1::^1
!2::^2
!3::^3
!4::^4
!5::^5
!6::^6
!7::^7
!8::^8
!9::^9

#HotIf

; --- UNIKEY ---

#space::!z

; Cannot use bellow :v, UniKeyNT doesn't read the key
; #space::try ControlSend "!z",, "ahk_exe UniKeyNT.exe"

; --- KOMOREBI ---

#^o::ReloadConfiguration()
#^+r:: {
  try RunWait("komorebic.exe stop", , "Hide")
  RunWait("komorebic.exe start", , "Hide")
}

#1::FocusWorkspace(0)
#2::FocusWorkspace(1)
#3::FocusWorkspace(2)
#4::FocusWorkspace(3)
#5::FocusWorkspace(4)
#6::FocusWorkspace(5)
#7::FocusWorkspace(6)
#8::FocusWorkspace(7)
#9::FocusWorkspace(8)
#0::FocusWorkspace(9)

#[::CycleWorkspace("previous")
#]::CycleWorkspace("next")

#+1::MoveToWorkspace(0)
#+2::MoveToWorkspace(1)
#+3::MoveToWorkspace(2)
#+4::MoveToWorkspace(3)
#+5::MoveToWorkspace(4)
#+6::MoveToWorkspace(5)
#+7::MoveToWorkspace(6)
#+8::MoveToWorkspace(7)
#+9::MoveToWorkspace(8)
#+0::MoveToWorkspace(9)

#+[::CycleMoveToWorkspace("previous")
#+]::CycleMoveToWorkspace("next")

#Left::Focus("left")
#Down::Focus("down")
#Up::Focus("up")
#Right::Focus("right")
^#+[::CycleFocus("previous")
^#+]::CycleFocus("next")

^#+Left::Move("left")
^#+Down::Move("down")
^#+Up::Move("up")
^#+Right::Move("right")
^#p::Promote()

#+Right::ResizeAxis("horizontal", "increase")
#+Left::ResizeAxis("horizontal", "decrease")
#+Up::ResizeAxis("vertical", "increase")
#+Down::ResizeAxis("vertical", "decrease")

#w::ToggleFloat()
#m::Minimize()
#q::Close()
^#t::ToggleTiling() ; avoid with opening terminal
#z::ToggleMonocle()
; !Enter::F11 ; Toggle fullscreen
^#r::Retile()
^#+p::TogglePause()

^#h::Stack("left")
^#l::Stack("right")
^#k::Stack("up")
^#j::Stack("down")
^#;::Unstack()

#x::FlipLayout("horizontal")
#y::FlipLayout("vertical")

My full komorebi.json:

{
  "app_specific_configuration_path": "$Env:USERPROFILE/.config/komorebi/applications.yaml",
  "window_border": true,
  "border_style": "System",
  "border_colours": {
    "monocle": "#F9E2AF",
    "single": "#B4BEFE",
    "stack": "#CBA6F7",
    "unfocused": "#45475A"
  },
  "border_offset": -2,
  "border_width": 6,
  "cross_monitor_move_behaviour": "Insert",
  "default_container_padding": 0,
  "default_workspace_padding": 0,
  "manage_rules": [
    {
      "id": "Messenger.exe",
      "kind": "Exe"
    },
    {
      "id": "MicrosoftWhiteboard.exe",
      "kind": "Exe"
    }
  ],
  "float_rules": [
    {
      "id": "Authy Desktop.exe",
      "kind": "Exe",
      "matching_strategy": "Equals"
    },
    {
      "id": "Cloudflare WARP.exe",
      "kind": "Exe",
      "matching_strategy": "Equals"
    }
  ],
  "border_overflow_applications": [],
  "monitors": [
    {
      "workspaces": [
        {
          "name": "0",
          "layout": "BSP",
          "workspace_rules": [
            {
              "id": "arc.exe",
              "kind": "Exe"
            },
            {
              "id": "chrome.exe",
              "kind": "Exe"
            },
            {
              "id": "edge.exe",
              "kind": "Exe"
            },
            {
              "id": "firefox.exe",
              "kind": "Exe"
            },
            {
              "id": "opera.exe",
              "kind": "Exe"
            }
          ]
        },
        {
          "layout": "BSP",
          "name": "1",
          "workspace_rules": [
            {
              "id": "explorer.exe",
              "kind": "Exe"
            }
          ]
        },
        {
          "name": "2",
          "layout": "BSP"
        },
        {
          "name": "3",
          "layout": "BSP"
        },
        {
          "name": "4",
          "layout": "BSP"
        },
        {
          "name": "5",
          "layout": "BSP"
        },
        {
          "name": "6",
          "layout": "BSP"
        },
        {
          "name": "7",
          "layout": "BSP",
          "workspace_rules": [
            {
              "id": "obs64.exe",
              "kind": "Exe"
            },
            {
              "id": "obs32.exe",
              "kind": "Exe"
            }
          ]
        },
        {
          "name": "8",
          "layout": "BSP",
          "workspace_rules": [
            {
              "id": "vlc.exe",
              "kind": "Exe"
            },
            {
              "id": "Spotify.exe",
              "kind": "Exe"
            }
          ]
        },
        {
          "name": "9",
          "workspace_rules": [
            {
              "id": "Messenger.exe",
              "kind": "Exe"
            },
            {
              "id": "zalo.exe",
              "kind": "Exe"
            }
          ]
        }
      ]
    }
  ],
  "mouse_follows_focus": false,
  "resize_delta": 20,
  "window_hiding_behaviour": "Cloak",
  "$schema": "https://raw.githubusercontent.com/LGUG2Z/komorebi/v0.1.22/schema.json"
}
LGUG2Z commented 4 months ago

@starise fixed the issue with threads not being terminated for border and stackbar windows ^

LGUG2Z commented 4 months ago

@KevinNitroG I'm guessing this might also have been the cause of your CPU temp issues 🤔

KevinNitroG commented 4 months ago

@KevinNitroG I'm guessing this might also have been the cause of your CPU temp issues 🤔

Do you think about reopening this issue, for anyone else having the same issue to find? Because I've just installed the latest version 0.1.27 and the CPU usage is not really positive. I'm staying at 0.1.25 for now...

LGUG2Z commented 4 months ago

the CPU usage is not really positive

I can't really make anything out of statements like these about CPU without hard numbers.

If you have CPU usage readings like this to share, or even better, comparative readings across different versions in similar conditions, it gives people something to investigate.

KevinNitroG commented 4 months ago

the CPU usage is not really positive

I can't really make anything out of statements like these about CPU without hard numbers.

If you have CPU usage readings like this to share, or even better, comparative readings across different versions in similar conditions, it gives people something to investigate.

Sorry that I couldn't help you much. That's only I can give you about my case. I don't know about threads and how to watch the threads or something. Try komorebic log and nothing seems to be related to the issue. I did try my best to show you the issue has not gone yet.