Slow "j" scrolling for large c++ files, In neovim.
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.
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.
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.
Is this with or without template function highlight?
I'm not sure - can you explain more? Is that a var/config setting?
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.