Closed tmainiero closed 6 years ago
You should mention which version of neovim you are using. It might not be worth trying to fix this on previous versions of neovim (0.3.0 is current). Also, there are a few very similar issues on the neovim tracker tracker (even down to mentioning airline).
Ah thanks. I'm using neovim 0.3.0 (nvim --version prints out "0.3.0-dev"). I'll also look for similar neovim specific issues. I switched to lightline to cut down on the CPU usage, but there's still something (albeit much more minor) happening.
Okay, just checking.. there must be some lingering neovim issues with timers.
@lervag, maybe TextChangedP
would work instead of the timer, when supported? This could also work around #1143.
Yes, this is most likely due to the popup check that you found. I'll look into @andymass's suggestions.
@tmainiero See #493 for the background of implementing these popup checks.
Ok, it seems TextChangedP
might fix the problem. Please update and try now. Note, this only works if you have a recent version if Vim (8.0.1494) or neovim.
Beautiful! Indeed, the issues I described are gone. Thank you both. The plugin is great and the speedy maintenance is a definite bonus.
Thanks, I appreciate the kind feedback! :)
Thanks for the wonderful plugin and all the hard work you continue to put into it.
I'm experiencing constant low-level CPU usage on .tex files. The usage is the same for large .tex files as well as empty ones and is persists when the (n)vim instance is out of focus. It is exacerbated with certain status-line plugins (especially nvim in combination with airline)---although this might be a separate but related issue.
My amateur diagnosis based off of some log files (see below) makes me suspect it is related to checking for parenthesis matching (calls to vimtex#matchparen#popup_check() ).
Apologies ahead of time if this is not really an issue, but some stupidity/unhealthy obsession on my part.
Minimal .vimrc:
Other : vim version: vim 8 ; behavior is independent of the terminal emulator (or use of gvim); running Ubuntu 14.04.
Observed Behavior: I'll give an idea of what I see on my system: using with the minimal .vimrc below (uncommenting zero or one of the statusline plugins), I reliably get the following constant background CPU usages when opening an empty .tex file; the usage is present regardless of whether the (n)vim instance is in focus or defocused/minimized.
vim:
nvim:
Any non-.tex file: No measurable background CPU usage for either vim or nvim.
Expected Behavior: No measurable (or only occasional) CPU usage when window is defocused and no interaction with (n)vim is occurring.
Yes I'm a crazy person and those numbers are low, but (among other reasons) I don't like it because I work with many .tex files constantly open in the background. (My laptop has an old battery and I always find myself squeezing out every drop of power.) When running nvim with a bunch of bells-and-whistles plugins called for other file types I don't see CPU usage when nvim is not in focus.
Some log files: I'm a vim newbie, but I attempted to profile vim to figure out what's causing this.
Profile log files: profile_nvim_noplug.log profile_vim_noplug.log profile_nvim_airline.log profile_vim_airline.log
As the filenames suggest, these were produced using vim or nvim and either no statusline plugins, or with airline.
To get these log files I used the following procedure:
Open nvim (or vim) on an empty .tex file using the above .vimrc :profile start profile.log :profile func * defocus (n)vim and wait ~9-11 seconds :profile pause :q!
The usage with no plugins seems to be due to the calling of vimtex#matchparen#popup_check() . (both vim and nvim call this ~300 times in the ~10 second period). With airline this function is still being called about the same number of times, but airline seems to be calling a lot more things in nvim.