-
-
Notifications
You must be signed in to change notification settings - Fork 148
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
Typying laggs due to slow completion #17
Comments
Can you give me an exact test case where the completion feels particularly slow? Then I can try to reproduce it and figure out how to speed it up. For me, path completion feels very snappy. I have not noticed any problems with it. On the other hand, I find that completing certain |
I have tried to do that using https://github.com/mafredri/zsh-async/, but the problem with async completion is that if the completion finishes when the Zsh Line Editor is no longer active, it simply will not update. So, basically, while typing and then you pause, the last couple of letters fail to trigger completion. It only worked as long as I kept typing, which didn't feel quite right. 🙂 |
Hmm okay it is my fault. Sorry for your inconvenience. It happens when my PC is under load. But is is quite "interesting". So it happens already when I run some simulations for work. but actually these just increase the CPU usage to ~30%. But doing more "tests", I recognized that this only happens for special cases. So I use TMux. So if I'm in a TMux window (I hope you know the terminology, it is like a terminal tab or a virtual desktop) and have the simulation running in one pane (like a window on a virtual desktop) and them simply do like |
But sad in general about the async stuff. Always nice to have it. :/ |
But glad it's not a problem in my plugin. 😉 |
Reopening, because @Mallchad reports the same problem. |
@Mallchad The problem was that |
It does indeed feel less laggy, although, it does not seem to be gone entirely. |
Thanks, I’ll investigate. |
@Mallchad I cannot reproduce it. When you make a misspelling, what do you do next? Do you just continue typing? Can you give me an example of a misspelling plus what you typed afterwards that made the completion slow? |
I usually have typed out a whole word / command by the time I have a chance to process the fact that I've made a mistake, but current it is made painfully aware to me that I've made the mistake because if I ignore, or don't realize the popup that is telling that I made a mistake. |
@Mallchad All right, I pushed in a new fix. You now get error correction on any path you type whenever you type a |
@Mallchad I watched your video several times, but I cannot tell the difference between you stopping with typing or the system lagging. 🙂 Can you please tell at which points exactly you experienced lag? With which inputs did the system get stuck? And what were the completions offered afterwards? |
Rather than post a video, I'd prefer if you could just type some test cases for me. 🙂 Like: "Given directory structure A, when I type B, the system hangs. Then, when the system resumes, it outputs C." |
If am looking for, say a binary in -Side note |
Thanks for the detailed description! I still cannot reproduce it at all, but now at least I have some idea of how to fix it. 🙂 |
@Mallchad I pushed in a new fix. Please try it out and let me know if it works. 🙂 |
@marlonrichert this is more than good enough. |
You're welcome! 🥳 I actually tried to implement asynchronous completion at some point, but it was very buggy —and not actually any faster. 😂 My current code does the automatic listing in a different way, though, than originally. So, I might give it a try again at some point. 🙂 |
@Mallchad How does this impact the performance of your shell? Is the shell refreshed each time your monitor refreshes? |
Ok, 1, asynchronous doesn't actually have to be faster to make a difference, it just needs to be non-blocking. ie, usually laggy behavior is because something is hanging up the process you're concentrated on. |
Hey,
thanks again for this plugin! 🙏
I use it now just my second day, but what really bothers me are the lags. This is especially the case for paths. Each time I enter a slash it starts to lag. I guess this will apply for all completions that are not optimized or simply slow.
I must admit I have rarely a knowledge of such things in Zsh, but is is possible to do asynchronous completion? As much as I like this plugin: this is a no-go for me at the moment. Maybe I need to disable completion sources that are slow. I don't know.
The text was updated successfully, but these errors were encountered: