counsel-fzf is slow when ran on the home directory
when using fzf in the terminal there is no lag what so ever, but using it with counsel-fzf in large directories like the home directory makes it slow
Same issue here.
This is because counsel-fzf is synchronously in the background. Meaning they have to scan every file before they return. fzf in the terminal is constantly scanning while you are typing so there is no delay.
@CeleritasCelery, counsel-fzf-function calls counsel--async-command, so it's rather asynchronous, plus :dynamic-collection t. As a result, at least for me, it's rocket-fast, and always was. Those who claim issues, should at least post versions of all the software stack they use, environment variables, and output of profiler-report.
it is async, but it waits for the process to exit before it collects the candidates. And dynamic-collection means that it has to be rerun after every input, which can also make it slow.
https://github.com/abo-abo/swiper/blob/master/counsel.el#L208
The terminal version does not have the limitation.
counsel-fzf is quite slow for me as well. I get much better performance from counsel-file-jump because it is not a dynamic collection.
I am experiencing some kinds of slowness as well, it is when C-n and C-p, navigating the ivy prompt, it feels a bit unresponsive. If I were to edit the prompt, ivy actually updates quite quickly. I think this is the behaviour for all ivy-read that has :dynamic-collection as t, which is what as of now, what I think what all these commands that are slow has in common, such as counsel-fzf, counsel-ag, counsel-grep.
I have just now realized that for these commands that seems slow to me, it is actually because the ivy prompt would not update selection (highlight) with consecutive C-n or C-p, until some certain delay, which is actually controlled by ivy-dynamic-exhibit-delay-ms.
After i set it to 0, it's fine for me now
This might mean that my issue is slightly different from what is described is this thread!
Got this as well, though I was able to get a snappier experience with fd: (setq counsel-fzf-cmd "fd -c never \"%s\"")
@Uthar thats for sharing, thats really awesome. Really snappy. With -H you also geht hidden but not ignored files.
;; counsel
(use-package counsel :ensure t
:config
(counsel-mode 1)
(setq counsel-fzf-cmd "fd -H -c never \"%s\""))
Maybe this should be the default? It's insane how much faster this is.
Maybe this should be the default? It's insane how much faster this is.
This, or maybe lets add a counsel-fd function? Should be very easy, and won't break current configs.