Closed alex-popov-tech closed 4 years ago
Since you have merely 2k items, which is a small dataset, all fuzzy finder should be fast in this case, even ctrlp.vim, let alone clap is expected to handle 1M items with Rust extension easily, see https://github.com/liuchengxu/vim-clap/issues/1#issuecomment-570006188.
I can't see the problem from the video, try using :h profile
to find which part is slow for you, refer to https://codeinthehole.com/tips/debugging-vim-by-example/#why-is-action-slow for more info.
I'm unsure if it's related to the rust binary is not latest. Since you already installed cargo, you can try building the Rust binary yourself instead of using the prebuilt binary. Try running make
in the plugin root directory.
The advantage of fzf.vim(or fzf) is the dynamic refresh, letting you feel more responsive. The good of clap is the ability to give the final determistic results much faster. You can try that, searching somthing in 1M items, clap will finish the job much faster than fzf.vim especially when the search string is very short, while fzf.vim is still freshing. The bad thing is the dynamic refresh is still missing in clap, see https://github.com/liuchengxu/vim-clap/issues/302.
If you do care about the performence(2k items is not deserved to talk about the perf), I would suggest you just using fzf.vim as I have to admit that fzf is more polished than clap's Rust binary, and fzf.vim now supports both floating_win of neovim and popup of vim too.
I would like to add there is a visible lag in opening Clap compared to fzf. Is it possible to minimize this lag?
try using :h profile to find which part is slow for you, refer to https://codeinthehole.com/tips/debugging-vim-by-example/#why-is-action-slow for more info.
Not sure how big is your dataset, you can find what is slowing you down using the profile, see :h profile
. Without the profile report, I don't know why you are meeting the slowness issue, thus can't give you more advices directly.
What's more, as I have said, the dynamic refreshing is missing at the moment, you have to wait for #353 and #364 for this feature.
If you are using vim, you can try decreasing g:clap_popup_input_delay
whose default value is 100ms.
The dataset is quite small, I am just using Clap files
.
Also I'm using nvim. I'm attaching the profile below.
My main problem is that there is slight lag when opening Clap, but the same is not present when fzf is opened.
Environment (please complete the following information):
Describe the bug I know that comparing this plugin to fzf.vim is not very relevant, but just to be more descriprive what would i expect from this plugin :) The problem is - when i typing some text in Clap fzf it loads very slowly and i can see several chars appear at the same time...long story short - here is the video https://share.getcloudapp.com/P8uRk8lB
Clap debug
To Reproduce Steps to reproduce the behavior:
Clap files
orClap gfiles
Note - it seems like lags disappear after some quantity of chars
Expected behavior Text should appear in search bar smoothly
Actual behavior While typing text is lagging
Additional context Video - https://share.getcloudapp.com/BluBYnLB