As reported in the following thread, Vim 8.0.1343 becomes slower on some
environments (when using some kind of commands like :ver, :dig, ...):
https://groups.google.com/d/topic/vim_dev/2AaZMN1T6K8/discussion
This PR optimizes text rendering and makes scrolling faster.
Also fixes that sometimes the cursor flickers when DirectX is used.
The important point is that gui_mch_flush() is very slow on DirectX.
(It takes about 5 ms or more on some environment.)
I found that gui_mch_flush() was called unnecessarily, especially when
updating the cursor. For example, there are many parts like this:
out_flush(); # ifdef FEAT_GUI if (gui.in_use) { gui_update_cursor(TRUE, FALSE); gui_mch_flush(); } # endif
gui_mch_flush() is called from the function out_flush(), then it is called
again right after gui_update_cursor(). I don't think the first call of
gui_mch_flush() is needed. I added two functions mch_disable_flush() and
mch_enable_flush() to control this. gui_mch_flush() is not called between
the two functions. I also added another function to make the above code
simpler. Now the above code becomes:
out_flush_cursor(TRUE, FALSE);
This calls gui_mch_flush() only once.
After disabling unnecessary calls of gui_mch_flush(), scrolling becomes
faster and cursor flickering is fixed.
Actually, this change affects all GUIs.
I hope someone tries this on GTK 2/3 or other platforms.
I also stop using ScrollWindowEx() on DirectX to optimize scrolling.
After the optimization, scrlines option in 'renderoptions' becomes
useless now. So I made it deprecated.
https://github.com/vim/vim/pull/2560
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub