indentLine icon indicating copy to clipboard operation
indentLine copied to clipboard

Performance issues

Open mpfusion opened this issue 10 years ago • 21 comments

While I really like your plugin, it makes vim unusably slow.

How to reproduce

wget https://raw.github.com/Yggdroot/indentLine/42cf0572926b9c415d2275e040bdcc60c33f9096/after/plugin/indentLine.vim
vim -N -u NONE -S indentLine.vim \
  -c 'syntax on|help grep|wincmd L|set relativenumber|norm 60G'

Then navigate up and down using j and k.

Result

Vim maxes out my 2GHz CPU and becomes unusably slow.

Expected result

A slight impact on performance but definitely not maxing out the CPU and slowing vim down that much.

Version

  • indentLine: 42cf057292
  • vim: 7.4b BETA, Included patches: 1-15

mpfusion avatar Aug 06 '13 22:08 mpfusion

I am having the same problem here. The longer the file is the worse it gets.

luan avatar Aug 28 '13 14:08 luan

I can confirm that performance is quite slow, also on Vim 7.4, with patches 1-7.

amadeus avatar Aug 31 '13 00:08 amadeus

Same for me (vim 7.4 from Debian Sid)

ajpaulson avatar Sep 19 '13 01:09 ajpaulson

Very slow for me. (Vim 7.4 on Windows 7 32-bit)

longwhale avatar Sep 22 '13 18:09 longwhale

Yea, this is even crushing macVim for me which is usually really fast.

jtmkrueger avatar Oct 02 '13 16:10 jtmkrueger

The performance issue depends on the files, has no relation with version of vim. If the file does not have many Long lines, the performance is good, for example the c code file. I update the plugin recently, if you want to have better performance, "let g:indentLine_faster = 1"

Yggdroot avatar Oct 30 '13 07:10 Yggdroot

I don't get it, why would I want slower performance?

luan avatar Oct 30 '13 14:10 luan

As you wish.

Yggdroot avatar Oct 30 '13 14:10 Yggdroot

let g:indentLine_faster = 1 didn't seem to help me. :(

ericboehs avatar Oct 31 '13 00:10 ericboehs

Can you explain this fix let g:indentLine_faster = 1 what are we trading for speed with this option ? If nothing then why isn't that default ?

yugaljindle avatar Nov 24 '13 10:11 yugaljindle

'let g:indentLine_faster = 1' can make the performance better, but indentLine will display on the non leading spaces. In my frequent use, I don't have the performance issue, so I don't let it to be default.

Yggdroot avatar Nov 26 '13 01:11 Yggdroot

Okay, but for me I loose all my vim speed without this option.

yugaljindle avatar Nov 26 '13 06:11 yugaljindle

Awesome. vim was almost unusable, took a bit of time to narrow down the fault to indent line plugin. "let g:indentLine_faster = 1" worked like a charm, almost up to normal performance (a very minuscule delay in loading files, nothing that breaks the flow). +1 for making this a default setting. thanks for the plugin & the fix.

let g:indentLine_faster = 1 seem to work, but it'll remove the leading spaces, is there a way to bring them back?

Leandros avatar Jan 22 '16 10:01 Leandros

Yeah, works like a charm. Thanks a lot for this fix!

syslino avatar Jan 27 '16 21:01 syslino

let g:indentLine_faster = 1 breaks haml syntax highlighting.

drzel avatar Aug 07 '16 03:08 drzel

I'm using deoplete for completion, when a preview window appears neovim is very slow, if I disable indentLine or the preview window, everything is normal. Any idea why is so slow when the preview window is present?

stsewd avatar Jun 22 '17 02:06 stsewd

Now the IndentLine has been reimplemented in a new way, maybe all the issue has been fixed. Please update it and try again. g:indentLine_faster is of no use now.

Yggdroot avatar Jun 22 '17 02:06 Yggdroot

It's not fixed! It still has totally unacceptable performance! Especially on JSX (html like) syntax. When file is opened first time - it's ok. But when I switch many times windows VIM scrolling become slower and slower each time (and finally cursor lags for 2-3 seconds). It does not happened when I switching between buffers.

alex-shamshurin avatar Oct 19 '17 16:10 alex-shamshurin

https://github.com/Yggdroot/indentLine/pull/224

alex-shamshurin avatar Oct 19 '17 17:10 alex-shamshurin

let g:indentLine_faster = 1 doesn't make any difference for me i have 500 lines file which is lagging a lot on scroll in the places like this image

Seybo avatar Sep 08 '20 06:09 Seybo