akiyosi / goneovim

A GUI frontend for neovim.
MIT License
2.4k stars 63 forks source link

High CPU load #345

Closed damanis closed 2 years ago

damanis commented 2 years ago

No specific scenario, just run goneovim:

image

$ goneovim --version nightly-2-gc6aa72c But some previous goneovim builds have same behavior settings.toml only set font; ExtPopupmenu and CachedDrawing can be true or false, don't matter.

akiyosi commented 2 years ago

@damanis Ummm, Maybe the following commitments may be relevant.

4d027183afeee9f0bcb7130225cf5847caa9753b

Will the above substantial parent commit artifact cause the issue? https://github.com/akiyosi/goneovim/actions/runs/2212310379

damanis commented 2 years ago

@akiyosi Same problem in $ ./Goneovim-latest-linux/goneovim --version nightly-3-g9427d30 There is low CPU in verion 0.5.1

akiyosi commented 2 years ago

@damanis Ummm, Thanks for confirming. Would this problem reproduce in the following command?

/path/to/goneovim -u NONE
akiyosi commented 2 years ago

@damanis Also, it would be helpful to start with the following and provide debug.log.

/path/to/goneovim --debug=/path/to/debug.log
damanis commented 2 years ago

@akiyosi 'goneovim -u NONE' has low CPU The debug.log: debug.log

akiyosi commented 2 years ago

@damanis Was this in a high load state while it was running, although there is very little log content?

Also, since it is not reproduced by goneovim -u NONE, it is possible that the problem is dependent on a specific setting or plugin, would it be possible for you to tell me your nvim settings and the plugin you use?

damanis commented 2 years ago

@akiyosi Goneovim v0.5.1 has low CPU with same configuration. I use few plugins: fzf-lua, lualine, nvim-treesitter. I've tried remove them - still 100% CPU. Other my plugins do nothing. FYI, other GUIs I used (fvim and nvui) use same plugins without high CPU. The nvim.appimage itself provides some plugins. Did you try it? The problem reproduced both with 0.7.0 release and 0.8.0 nightly build.

akiyosi commented 2 years ago

@damanis If the plugin has nothing to do with it, it may have something to do with neovim settings. What settings do you set? For example, options, keymaps, etc.

Also, I have the oldest CI artifacts in the Github actions in the repository right now. https://github.com/akiyosi/goneovim/actions/runs/1986395379

damanis commented 2 years ago

@akiyosi This version has low CPU load. I may send you my settings, but prefer by mail. (Next week and half I will have no access to my computer and wouldn't test something).

akiyosi commented 2 years ago

@damanis Thanks, OK.

What about the following version?

https://github.com/akiyosi/goneovim/actions/runs/2007538150

Note that WindowGeometryBasedOnFontmetrics in the settings.toml introduced in this version, if enabled, may indeed continue to resize the window indefinitely, and the CPU may reach 100%, but I understand that this setting is disabled according to your prior information I understand that according to your prior information, this setting is disabled.

damanis commented 2 years ago

@akiyosi Yes, this parameter is disabled (it didn't work, seems, I didn't understand something). I'll check this build after vacation. You can't reproduce the problem, correct?

mars0i commented 2 years ago

As noted in #338, I am experiencing this problem with a new build on MacOS. I don't have high CPU usage with an earlier nightly release, nightly-1-g0e35e77. With my new build -u NONE does get rid of the high CPU usage.

I tried running with --debug=, both with the new build and the other version I'm using. After I strip out the timestamp and id columns, the log file for the two versions of goneovim are identical except that the new build included one extra line: "key input: , 16777249, 0".

I'll experiment further with my plugins. I can upload or send my config files if that would be helpful.

mars0i commented 2 years ago

Here is something relevant: With my new build, if I use an empty ~/.config/nvim/init.vim, I don't get high CPU usage, as one would expect from the the "-u NONE" test. If I add "set columns=80" and nothing else to init.vim, I get high CPU usage. I found this out by eliminating various parts of my configuration.

The set columns function is a new enhancement for #334, but maybe there is an interaction with a more recent change, since nightly-1-g0e35e77 also allows set columns and doesn't have high CPU usage.

(I wondered whether it could have to do a warning I got about libs being built for different MacOS versions here, but since you are on Linux @damanis, that seems unlikely.)

akiyosi commented 2 years ago

@damanis @mars0i Thanks for the information. I believe I have been able to reproduce this issue and have fixed the problem.

https://github.com/akiyosi/goneovim/actions/runs/2243636829

The cause is probably commit 5460d84a3a12f4d22, which is a bug I embedded when I improved the cursor update process. It seems that this bug caused the timer for cursor blinking process to keep initializing with no wait time when the wait time involved in the cursor blinking process is set at 0, and this was causing the CPU to run at 100%.

mars0i commented 2 years ago

Thanks @akiyosi! In my initial test, I did not see high CPU load. I'll keep checking and let you know if I do.

damanis commented 2 years ago

@akiyosi Great news!

damanis commented 2 years ago

@akiyosi Last build (https://github.com/akiyosi/goneovim/actions/runs/2304765278) has no high CPU.