kovidgoyal / kitty

Cross-platform, fast, feature-rich, GPU based terminal
https://sw.kovidgoyal.net/kitty/
GNU General Public License v3.0
23.01k stars 923 forks source link

Extreme performance regressions when opening file containing UTF-8 #6896

Closed atiedebee closed 7 months ago

atiedebee commented 7 months ago

Opening a UTF-8 file using a terminal editor like vim or kakoune causes severe performance regressions. In my case, opening the attached file caused CPU usage to skyrocket to 50% over the entire system (8 core Ryzen 7 6850U).

I attached the file to the report so it can (hopefully) be reproduced. sle-classic.desktop.txt

Environment:

kitty 0.29.2 created by Kovid Goyal
Linux ryzen7 5.14.21-150500.55.36-default #1 SMP PREEMPT_DYNAMIC Tue Oct 31 08:37:43 UTC 2023 (e7a2e23) x86_64
Welcome to S - Kernel 5.14.21-150500.55.36-default (/dev/tty).

eth0: 4{eth0} 6{eth0}
wlan0: 4{wlan0} 6{wlan0}

Running under: X11
Frozen: False
Paths:
  kitty: /usr/bin/kitty
  base dir: /usr/lib64/kitty
  extensions dir: /usr/lib64/kitty/kitty
  system shell: /bin/bash
Loaded config files:
  /home/*/.config/kitty/kitty.conf

Config options different from defaults:
enable_audio_bell       False
font_size               20.0
repaint_delay           16
Colors:
    active_border_color     #4f4f4f   
    active_tab_background   #242424   
    active_tab_foreground   #fcfcfc   
    background              #1d1d1d   
    bell_border_color       #ed333b   
    color0                  #1d1d1d   
    color1                  #ed333b   
    color10                 #8ff0a4   
    color11                 #ffa348   
    color12                 #99c1f1   
    color13                 #dc8add   
    color14                 #93ddc2   
    color15                 #f6f5f4   
    color2                  #57e389   
    color3                  #ff7800   
    color4                  #62a0ea   
    color5                  #9141ac   
    color6                  #5bc8af   
    color7                  #deddda   
    color8                  #9a9996   
    color9                  #f66151   
    cursor                  #deddda   
    cursor_text_color       #1d1d1d   
    foreground              #deddda   
    inactive_border_color   #282828   
    inactive_tab_background #303030   
    inactive_tab_foreground #b0afac   
    selection_background    #303030   
    selection_foreground    #c0bfbc   
    url_color               #1a5fb4   

Important environment variables seen by the kitty process:
    PATH                                /home/*/bin:/usr/local/bin:/usr/bin:/bin
    LANG                                en_US.UTF-8
    EDITOR                              kak
    SHELL                               /bin/bash
    DISPLAY                             :0
    USER                                alex
    XDG_VTNR                            7
    XDG_SESSION_ID                      23
    XDG_SESSION_TYPE                    x11
    XDG_DATA_DIRS                       /home/**/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
    XDG_SESSION_DESKTOP                 
    XDG_SESSION_CLASS                   user
    XDG_SEAT_PATH                       /org/freedesktop/DisplayManager/Seat0
    XDG_CURRENT_DESKTOP                 
    XDG_SEAT                            seat0
    XDG_RUNTIME_DIR                     /run/user/1002
    XDG_SESSION_PATH                    /org/freedesktop/DisplayManager/Session13
    XDG_CONFIG_DIRS                     /etc/xdg

Additional context Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

kovidgoyal commented 7 months ago

Does not reproduce for me using up-todate kitty and vim.