-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow selection with many files #276
Comments
Oh, that are a lot of files :D The problem is with file completions as I tested with touch {1..60000} And start completion using (completing-read "Check: "
(mapcar #'number-to-string
(number-sequence 0 60000))) This might also be connected to the reported tramp issues #210 |
@clemera But if you use numbers, the strings are much shorter. I am sure this has some effect. Did you test many long strings? I mean there are the issues with long strings in the consult-help experiment. |
Yes that also has an effect but the file problem still exists with the number example. The problem seems to be that the internal collection function is unusable slow with so many file as you can test using: (read-file-name-internal "~/playground/files/" nil t) |
We call it on every input change I guess a simple workaround would be to only recompute on directory change for file completions, that would still give you an initial delay but not on every keypress afterwards. |
Maybe check what ivy does differently - is there some internal API they work around and Selectrum cannot?
This would fix the lagging when pressing keys. |
I checked and they use the same function, they are also equally slow initially but the result is cached so there is no lag on each input for ivy. |
@SebastienWae |
It's much better! Initial load time is still slow (but that's not really a Selectrum issue) and once it's loaded it only has a small delay which is more than acceptable considering the size of the list. |
Slower than ivy? |
I would have to benchmark it to be sure but it feels the same at ~1-2 seconds. |
With #277 merged can this be closed? |
Opening a new issue because #195 has been close for a few months.
Selectrum is very slow, 1-2 seconds delay between each key press and ui update, on a 61k+ list of file.
I have tried with and without orderless and prescient, it didn't made any changes.
Ivy with and without prescient has a much lower delay ~500 ms.
This is using Emacs native-comp branch on NixOS.

The text was updated successfully, but these errors were encountered: