After installing vim-airline and enable it, vim become slower when the file is more and more large. Yestoday I was editing a file which has almost 9000 lines total, I found vim
got slow! Then I remove the vim-airline plugin and restart vim with the same file, everything seems OK . Is anyone else having this problem ?
set laststatus=2 " Always show the statusline
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline#extensions#tagbar#enabled = 1
let g:airline#extensions#tagbar#flags = 's'
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme='dark'
let g:airline_detect_modified=0
let g:airline_detect_paste=0
let g:airline_left_sep = '⮀'
let g:airline_left_alt_sep = '⮁'
let g:airline_right_sep = '⮂'
let g:airline_right_alt_sep = '⮃'
let g:airline_symbols.branch = '⭠'
let g:airline_symbols.readonly = '⭤'
let g:airline_symbols.linenr = '⭡'
let g:airline_section_c = '%F'
let g:airline#extensions#default#layout = ([
\ [ 'a', 'b', 'c',],
\ [ 'x', 'y', 'z' ]
\ ])
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#excludes = []
let g:airline#extensions#tabline#tab_nr_type = 1 " tab number
let g:airline#extensions#tabline#formatter = 'default'
let g:airline#extensions#tabline#left_sep = '⮀'
let g:airline#extensions#tabline#left_alt_sep = '⮁'
let g:airline#extensions#tabline#right_sep = '⮂'
let g:airline#extensions#tabline#right_alt_sep = '⮃'
let g:airline#extensions#branch#enabled = 1

can you see if disabling the whitespace extension makes a difference?
@bling Thanks for your advice.
I put "let g:airline#extensions#whitespace#enabled = 0" in my vimrc file. But I got nothing improved.
I think the reason why vim becoming slow alter installing airline is that maybe there are too many AUTO COMMANDS in airline.
can you create some performance profiles for me? you can still the mappings from my minivimrc project. thanks.
@bling The large file which I edited and the performance profiles and my vimrc file are all send by email to you. Hope to
find the problem soon. Many Thanks.
thanks for sending me the reference file (that's a first!). unfortunately, i did not notice any slowdowns. i tried opening the file with my vimrc, and also using your vimrc as well. when you say "slow", do you mean there's a lag when typing, switching windows, or something else?
also, i noticed in the logs you send me that CSApprox is also taking quite a bit of CPU as well (it's actually take more total time than airline), and i'm wondering if there's somehow a conflict happening here. can you try disabling that and see if it makes a difference?
and since we're using the same configs and seeing different results...what OS and version of vim are you running? thanks.
@bling vim 7.4 Mac OS X 10.9.1
perf is shot for me as well when trying to use vim-airline. If I have two files open in splits in about a 1500x1500 window in terminal vim things are super sluggish. Specifically, ctrlp is quite laggy.
I've trimmed my vim config down to just vim-rails, vim-airline, ctrlp. It still gets laggy eventually w/o vim-rails, but vim-rails seems to exacerbate it.
The file i'm testing w/ is a 236 line rails model. If I open it in two splits, ctrlp is pretty bad.
I have no such problems w/ powerline.
My pared down config for test is here: https://github.com/aaronjensen/vimfiles/tree/slow-vim-airline
I'll email you the profile.log
I couldn't find your email address...
@aaronjensen updated my profile, should be there now.
@aaronjensen
does running on a smaller resolution like 1024x768 make a difference?
The smaller the window, the faster it is. There's definitely a correlation.
what exactly is slow here? the profile log you sent me points everything at the initialization/matching time for ctrlp. all functions are executing within less than 1ms.
the place where I feel the slowdown the most is while doing a ctrlp fuzzy find. It lags behind my typing quite a bit, but really everything is sluggish. Switching windows, switching to insert mode. All takes a noticeable amount of time.
would you mind sending me another profile log where you have roughly 100 key strokes in each of normal mode, insert mode, and ctrlp matching mode? that'll help me pinpoint any obvious problems. i don't see any slowdowns with your branch of dotfiles...but then again i don't have access to a big screen either :wink:
Sent. You can reduce your font size to something very small to act like a large screen. Also, I'm using iterm2 Build 1.0.0.20140112
gisting it for reference: https://gist.github.com/bling/9309964
sorry but unfortunately i still have no luck reproducing, even with a font size of 2 (nice trick btw). and this over a SSH to a remote machine as well....
i'm highly suspicious why the call to redraw within ctrlp is taking up pretty much all the time on your machine....does the same behavior happen in macvim?
yes, mvim in gui mode has the same problem. As does the brew installed vim that I have.
If I comment out the contents of function! airline#highlighter#exec(group, colors) then switching modes between insert and normal is fast and does not have lag.
ctrlp is still slow though.
Sorry @bling, after more testing I think I may have sent you on a wild goose chase. I was able to reproduce the slowness w/o vim-airline. I think that my particular problems had to do with the new regexpengine set re=1 helped greatly. I'm also trying:
set ttyfast
set lazyredraw
though it's not clear those are helping too much. Sorry for the trouble :/
Super late to this, but first time install airline and encountered a similar issue. Found a nice solution should anybody else stumble along this down the line.
Following this guide fixed the issue nicely for me:
http://usevim.com/2013/07/24/powerline-escape-fix/
Super late to this, but first time install airline and encountered a similar issue. Found a nice solution should anybody else stumble along this down the line.
Following this guide fixed the issue nicely for me:
http://usevim.com/2013/07/24/powerline-escape-fix/
Sorry for the late reply, I had a similar issue with vim. @andrewparrish the link you provided is dead, thanks for posting your solution.
I leave a new link here.
https://medium.com/usevim/powerline-escape-fix-e849fd07aad0
just want to mention this is happening to me. vim loading and vim save are very slow with vim-airline.
I understand vim-airline works with other plugins that may be installed. Is there any way I could debug if it's some kind of integration or the vanilla implementation?
Just read the wiki and found out it was the extensions, this fixed the problem for me magically:
# ~/.vimrc file
let g:airline_extensions = []
Most helpful comment
Just read the wiki and found out it was the extensions, this fixed the problem for me magically: