Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Neovim CPU usage #27

Closed
amerov opened this issue Mar 26, 2018 · 6 comments
Closed

Neovim CPU usage #27

amerov opened this issue Mar 26, 2018 · 6 comments

Comments

@amerov
Copy link

amerov commented Mar 26, 2018

This plugin caused CPU usage

neovim 0.2.2

After adding this plugin neovim always use CPU
screenshot from 2018-03-27 00-49-40

Profile output:

FUNCTIONS SORTED ON TOTAL TIME
count  total (s)   self (s)  function
   70   0.072696   0.003727  airline#extensions#branch#get_head()
   70   0.068968   0.003924  airline#extensions#branch#head()
   70   0.047848   0.008579  <SNR>144_update_branch()
   70   0.032773   0.003150  <SNR>144_update_git_branch()
   70   0.029623   0.002470  fugitive#head()
  140   0.029335   0.017666  airline#extensions#ale#get()
   70   0.021974   0.006070  <SNR>72_repo_head()
   70   0.021736   0.014295  airline#extensions#hunks#get_hunks()
   70   0.020920   0.018225  airline#extensions#whitespace#check()
   70   0.017196   0.014387  <SNR>144_update_untracked()
   70   0.016022   0.001103  airline#extensions#ale#get_warning()
   70   0.015737             airline#check_mode()
   70   0.015471   0.001055  airline#extensions#ale#get_error()
  490   0.014244             airline#util#append()
  630   0.009749             airline#util#wrap()
  140   0.009622             <SNR>72_repo()
  140   0.009533   0.002630  ale#statusline#Count()
   70   0.008830   0.006783  <SNR>72_repo_head_ref()
   70   0.007441   0.004522  <SNR>142_get_hunks()
  140   0.007016             airline#util#shorten()

FUNCTIONS SORTED ON SELF TIME
count  total (s)   self (s)  function
   70   0.020920   0.018225  airline#extensions#whitespace#check()
  140   0.029335   0.017666  airline#extensions#ale#get()
   70              0.015737  airline#check_mode()
   70   0.017196   0.014387  <SNR>144_update_untracked()
   70   0.021736   0.014295  airline#extensions#hunks#get_hunks()
  490              0.014244  airline#util#append()
  630              0.009749  airline#util#wrap()
  140              0.009622  <SNR>72_repo()
   70   0.047848   0.008579  <SNR>144_update_branch()
  140              0.007016  airline#util#shorten()
  140              0.006903  <SNR>225_GetCounts()
   70   0.008830   0.006783  <SNR>72_repo_head_ref()
   70              0.006496  <SNR>144_update_hg_branch()
   70   0.021974   0.006070  <SNR>72_repo_head()
   70              0.005438  airline#parts#ffenc()
   70              0.005251  airline#extensions#fugitiveline#bufname()
   70   0.006141   0.004569  airline#extensions#tagbar#currenttag()
   70   0.007441   0.004522  <SNR>142_get_hunks()
   70              0.004511  airline#parts#spell()
   70   0.068968   0.003924  airline#extensions#branch#head()
@amerov
Copy link
Author

amerov commented Mar 26, 2018

I catched that it caused by enabling matchup_matchparen_deferred

@andymass
Copy link
Owner

I take this issue very seriously. Can you please verify it happens with the minimal example init.vim:

set nocompatible

" change this path to where the plugin is located
let s:matchup = '~/.config/nvim/bundle/vim-matchup'

let &rtp  = s:matchup . ',' . &rtp
let &rtp .= ',' . s:matchup . '/after'

filetype plugin indent on
syntax on 

" relevant options here
let g:matchup_matchparen_deferred = 1

@amerov
Copy link
Author

amerov commented Mar 26, 2018

with above config it is ok.
it happens with airline.

@andymass
Copy link
Owner

I think I can reproduce this:

  with airline only: 0% CPU
  with match-up only: 0% CPU
  with airline and match-up: 3--4% CPU

It makes no sense. When the cursor is not moving, the deferred timer is in a paused state and should consume no CPU. I verified the callback is not being triggered when the cursor is not moving. I don't see why it relates to airline.

This might be a neovim bug, and it might be related to this neovim/neovim#7871

@andymass
Copy link
Owner

andymass commented Mar 26, 2018

cf. neovim/neovim#8188

@andymass
Copy link
Owner

Fixed in neovim 0.3.0, recently released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants