Yggdroot / LeaderF

An efficient fuzzy finder that helps to locate files, buffers, mrus, gtags, etc. on the fly for both vim and neovim.
Apache License 2.0
2.14k stars 178 forks source link

Create global variable to allow disable MRU feature #1006

Closed jerryyin closed 1 year ago

jerryyin commented 1 year ago

Description

augroup LeaderF_Mru is quite expensive. In my local profiling, this will result in the invokation of lfMru#record(). This becomes a most expensive operation when I'm switching between different buffers.

Analysis

The implementation of this record function is such that each time when I enter a new buffer, it will result in a file write:

call writefile(..., g:Lf_MruCacheFileName)

Writing to a file for 3 times will cost around 0.13 seconds.

Suggestion

Define a global variable (for example, g:Lf_MruEnable to allow user to disable the autogroup if a user doesn't need MRU feature.) This way I can avoid this additional file write to enhance my vim performance.

Yggdroot commented 1 year ago

Done.

jerryyin commented 1 year ago

@Yggdroot Thank you! Appreciate your help.