vim-cpp-enhanced-highlight icon indicating copy to clipboard operation
vim-cpp-enhanced-highlight copied to clipboard

Slow "j" scrolling for large c++ files, In neovim.

Open leira opened this issue 10 years ago • 5 comments

Well, scrolling using just "j" is definitely not a good idea, but it's the way I can constantly reproduce this issue.

I'm using neovim. When I editing a large cpp file, around 4000 lines, without vim-cpp-enhanced-highlight plugin, I can just "j" from top to bottom line by line without any choke, With vim-cpp-enhanced-highlight on, when I "j" down from the top, it was fine the begining, but after 300 lines, it started to jump, and started to have half second delay between jumps.

I do have YouCompleteMe installed, which is supposed to be big and might be slow, I'm not sure if YCM is related to this slow down issue or not, but as long as I disabled vim-cpp-enhanced-highlight, this issue was gone.

leira avatar Oct 16 '15 19:10 leira

Yes I agree this a big issue, and I'm not sure there is an easy way around it. Other plugins that does similar type of highlighting seem to suffer the same slowdown.

octol avatar Oct 29 '15 18:10 octol

same problem here - I ran a quick syntime report and I consistently found these at the top:

  0.176170   5470   0       0.000258    0.000032  cppRawString       \%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(
  0.099452   5470   0       0.000131    0.000018  cppRawString       \%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(

Dunno if that helps or not.

mellery451 avatar Jul 25 '16 21:07 mellery451

Is this with or without template function highlight?

octol avatar Oct 19 '16 21:10 octol

I'm not sure - can you explain more? Is that a var/config setting?

mellery451 avatar Oct 19 '16 23:10 mellery451

Enabling highlighting of template functions via

let g:cpp_experimental_simple_template_highlight = 1

or alternatively

let g:cpp_experimental_template_highlight = 1

can slow down parsing by quite a bit.

octol avatar Nov 03 '16 09:11 octol