Hi Bram,

I have been investigating some pathological performance problems with 
YouCompleteMe (YCM). YCM is a vim plugin which, in effect calls complete() on 
every keystroke in insert mode. I have noticed that sometimes, vim can become 
extremely slow while typing in this scenario.

I did some profiling with callgrind and found that 99% of the time was 
redrawing, and in particular syntax highlighting regex code. Of course, doing 
something very often makes it appear “slow”.

Anyway, my solution has been to reduce the number of times I call complete(), 
but I’m still curious if this can be improved. I’m not super clear on the exact 
set of calls here, but looking at the code it _appears_ that we force a redraw 
of all windows whenever the pum is undisplayed (pum_undisplay calls 
redraw_all_later(UPD_NOT_VALID), which is called by set_completion, via 
ins_compl_free, etc.).

I think this also happens when any key is pressed while the pum is displayed 
(however it is displayed).

Am I understanding the behaviour correctly - that a full redraw is requested 
whenever the pum is visible and a key is pressed, or complete() is called?
Is there a way this redraw can be reduced? I seem to recall that popup windows 
have a clever way to minimise the redraw by storing what they are obscuring (or 
did I imagine that?).

I’m may have some time/impetus to work on this if it’s a plausible direction.

Cheers,
Ben

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/60D6020C-EB74-4A43-A278-1EFA3DC79CAF%40gmail.com.

Raspunde prin e-mail lui