vim-matchmaker icon indicating copy to clipboard operation
vim-matchmaker copied to clipboard

Improve Performance

Open xanderdunn opened this issue 10 years ago • 5 comments

Matchmaker causes quite a performance drain when I'm navigating large source files.

See this screen recording where just navigating up and down lines of code if very slow and laborious with Matchmaker turned on, but very fast and smooth with Matchmaker turned off.

I'd like to keep Matchmaker always turned on, like most GUI IDEs. However, doing so is too much of a performance drain right now. How about not triggering Matchmaker until the cursor has come to rest? This is the behavior in Xcode.

xanderdunn avatar Jan 03 '15 04:01 xanderdunn

I'll look into that possibility, but it all comes down to whether or not Vim supports that behaviour. I don't think it does. I'm not aware of any autocmd that triggers after the cursor stops moving, and I don't think vim can register a tick function or anything like that.

On Fri, 2 Jan 2015 23:16 Alex Dunn [email protected] wrote:

Matchmaker causes quite a performance drain when I'm navigating large source files.

See this screen recording https://github.com/alexdunn/storage/raw/master/matchmaker_performance.mov where just navigating up and down lines of code if very slow and laborious with Matchmaker turned on, but very fast and smooth with Matchmaker turned off.

I'd like to keep Matchmaker always turned on, like most GUI IDEs. However, doing so is too much of a performance drain right now. How about not triggering Matchmaker until the cursor has come to rest? This is the behavior in Xcode.

— Reply to this email directly or view it on GitHub https://github.com/qstrahl/vim-matchmaker/issues/16.

qstrahl avatar Jan 03 '15 07:01 qstrahl

I haven't written a vim plugin, but what about doing it asynchronously?

When the matchmaker plugin receives the call that the cursor has moved, wait for a given period of time. Maybe 1 second. If matchmaker doesn't receive another cursor moved call within that time period, then tell vim to do the highlighting.

xanderdunn avatar Jan 03 '15 07:01 xanderdunn

Vim doesn't do asynchronous. At least not without some severe python hackery, and even then I've never seen it end without trouble, and wouldn't know where to begin anyway.

On Sat, 3 Jan 2015 02:48 Alex Dunn [email protected] wrote:

I haven't written a vim plugin, but what about doing it asynchronously?

When the matchmaker plugin receives the call that the cursor has moved, wait for a given period of time. Maybe 1 second. If matchmaker doesn't receive another cursor moved call within that time period, then tell vim to do the highlighting.

— Reply to this email directly or view it on GitHub https://github.com/qstrahl/vim-matchmaker/issues/16#issuecomment-68586730 .

qstrahl avatar Jan 03 '15 07:01 qstrahl

What about CursorHold?

On Sat, Jan 3, 2015, 2:54 AM Quinn Strahl [email protected] wrote:

Vim doesn't do asynchronous. At least not without some severe python hackery, and even then I've never seen it end without trouble, and wouldn't know where to begin anyway.

On Sat, 3 Jan 2015 02:48 Alex Dunn [email protected] wrote:

I haven't written a vim plugin, but what about doing it asynchronously?

When the matchmaker plugin receives the call that the cursor has moved, wait for a given period of time. Maybe 1 second. If matchmaker doesn't receive another cursor moved call within that time period, then tell vim to do the highlighting.

— Reply to this email directly or view it on GitHub < https://github.com/qstrahl/vim-matchmaker/issues/16#issuecomment-68586730>

.

— Reply to this email directly or view it on GitHub https://github.com/qstrahl/vim-matchmaker/issues/16#issuecomment-68586866 .

tommcdo avatar Jan 03 '15 12:01 tommcdo

That'll probably do it. I forgot about that. =P

On Sat, 3 Jan 2015 07:48 Tom McDonald [email protected] wrote:

What about CursorHold?

On Sat, Jan 3, 2015, 2:54 AM Quinn Strahl [email protected] wrote:

Vim doesn't do asynchronous. At least not without some severe python hackery, and even then I've never seen it end without trouble, and wouldn't know where to begin anyway.

On Sat, 3 Jan 2015 02:48 Alex Dunn [email protected] wrote:

I haven't written a vim plugin, but what about doing it asynchronously?

When the matchmaker plugin receives the call that the cursor has moved, wait for a given period of time. Maybe 1 second. If matchmaker doesn't receive another cursor moved call within that time period, then tell vim to do the highlighting.

— Reply to this email directly or view it on GitHub <

https://github.com/qstrahl/vim-matchmaker/issues/16#issuecomment-68586730>

.

— Reply to this email directly or view it on GitHub < https://github.com/qstrahl/vim-matchmaker/issues/16#issuecomment-68586866>

.

— Reply to this email directly or view it on GitHub https://github.com/qstrahl/vim-matchmaker/issues/16#issuecomment-68593955 .

qstrahl avatar Jan 04 '15 00:01 qstrahl