ericdanan/counsel-projectile

Defer real-time search till n characters

swarnendubiswas opened this issue · 8 comments

For large projects, counsel-projectile starts searching for files as soon as a user starts typing. This leads to a large initial lag and some stuttering. I think it may be good to introduce a configuration to allow to defer searching for files till n characters have been input.

Maybe this should be supported in the base projectile if not already there?

When exactly do you experience these delays? Before calling counsel-projectile and seeing the list of files in the minibuffer? Or when you start typing? Or both?

I have projectile-indexing-method set to hybrid on an Ubuntu 18.04 system.

The lag comes for large projects like TensorFlow with around 20000 files listed. I am talking about the lag that comes when I start typing characters to find files because of a large number of matches.

I downloaded this project and filtering happens instantly as I start typing. The only delay I see is when I call counsel-projectile-find-file for the first time and before I type anyhing, as the projectile cache is being initialized. Do you have projectile-enable-caching set to `t'?

Yes, I have projectile-enable-caching set to t. I also have entries in .projectile to leave out useless extensions.

I will check on a couple of other Linux machines.

OK. I don't think the entries in .projectile would cause the delay. Perhaps you can test is projectile-find-file is faster.

The performance of both are the same, I experience the lag on older configurations. I do not think the issue is between the two packages. I was thinking as more of a configuration option where the user is going to type in at least say n characters before the search is initiated.

I just implemented this, please set the variable counsel-projectile-find-file-more-chars and test.

Yes, it works. I hope it will be useful for other users as well.