vim / vim

The official Vim repository

Home Page:https://www.vim.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High CPU usage on Fedora 40

zhscn opened this issue · comments

commented

Steps to reproduce

  1. Open one log file, here is an example of mine, the complete file size is about 250M
    log.txt
  2. Press Ctrl-D to continue scrolling down.
  3. CPU usage reaches 100%
    Screenshot from 2024-04-27 11-02-12

flamegraph:
flamegraph

Expected behaviour

CPU usage should be at a low level.

Version of Vim

9.1.309

Environment

OS: fedora 40
terminal: gnome-terminal-3.50.1-6.fc40.x86_64
$TERM: xterm-256color

Logs and stack traces

No response

commented

git bisect shows that 9148ba8 caused this problem.

Vim with --clean and the LargeFile plugin (available from
here and here) may also help:

vim --clean -Nu NONE '+set pp=~/.vim rtp=~/.vim' log.log

Hmm almost missed this despite the ping because of the nondescript issue title.
We just spend a lot of cycles in plines_m_win() with limit_winheight == FALSE. We need to count until w_height + count so limit_winheight == TRUE doesn't work. Could add a new argument to plines_m_win() to that end.