-
Notifications
You must be signed in to change notification settings - Fork 127
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
How to improve speed or make it faster? #620
Comments
That's interesting! Thanks for reporting this. I don't experience that, so I have some questions to help troubleshoot what's happening:
|
Autosuggest seems to have unlagged it a bit, but now it doesn't auto complete haha.
I only have oh-my-posh and there is no delay when you press Space. Here are specs:
|
For comparison:
The PATH variable has some large directories listed twice, and that could potentially slow down autosuggest (while it collects completions), but on the other hand autosuggest is designed to run mostly asynchronously and shouldn't be interfering with typing. It's interesting that turning off colorize cleared up the lag. That means the lag is primarily coming from running Lua scripts to parse the input line. But it looks like you said as far as you know the only Lua script you have loaded in Clink is one for oh-my-posh. Some more troubleshooting questions:
|
Here's a better question: The system info you shared says Do you experience any lag when typing in bash? I ask because here is what happens when I typed jumbled letters as quickly as my fingers can randomly hit them:
This is interesting, because both Clink and bash are using Readline. Once I realized I could reproduce a small bit of lag with ultra high speed random input, then I started doing some performance profiling, and I started disabling lots of different features that the profiler showed as using time. But no matter what I turn off, it only has an infinitesimal affect on reducing lag. And bash itself seems to have even more lag than Clink. So I'm curious whether you experience lag in bash. |
And I experience a small lag when typing into plain CMD.exe's command prompt (without Clink). And when I added detailed logging about delays, there is a small amount of lag even when the APIs claim to be receiving input instantly when it's available. I can stop typing, and it takes another 100-200 ms for another 6 or so letters to show up one by one, and yet the logging says for each of the letters there isn't input available yet, and it has to wait for 15 to 20 milliseconds before the OS APIs have any input available -- even after I've completely stopped typing, the input APIs still experience waits before the input I already finished typing actually becomes available. That particular delay is happening in something lower-level than Clink. The lag that I'm experiencing seems to have nothing to do with Clink. I experience it in Windows Terminal, in ConEmu, in mintty, and in the old default conhost (standalone legacy default console windows), regardless whether Clink is present or not. I'm not sure what's going on here, but the lag I'm able to experience seems to be independent from Clink. So I'm also curious what terminal you're using. |
I did not particularly experience any lag, but I just saw this issue and recently I have seen a Video that mentioned the slow windows console layer and a way on "bypassing the windows console layer", maybe this is of interest for you: https://youtu.be/hxM8QmyZXtg?t=1155 Thanks for your great work btw, I really enjoy the clink experience! :) |
That's an interesting video, thanks for sharing it. It's about a very different issue than input lag. I'm not seeing output lag (performance measurements confirm I'm not experiencing output lag or slow output). Instead I'm seeing a tiny amount of input lag when hammering keys at around 200 wpm. And I think that's the same thing you're hitting. It's not output that's slow. The console input APIs are saying input isn't available for a few milliseconds even when multiple keys are queued already. That's where the slowness is coming from. Re: the video, it's worth noting there's a lot of criticism in the video, but also a lot of "I don't know what it's doing and why it's slow" combined with "my code handles everything ... except for the following things which are really the hard parts". Which feels odd, because yeah if one removes all the code that handles all the hard stuff, then it's going to be faster. He's got some interesting points. But he claims it's an apples to apples comparison, and that doesn't seem accurate. And the super fast mode seems to disable ANSI escape code handling and colors and all that kind of stuff. I wonder whether the author hasn't gotten to thinking through all the things that the "terrible and slow" code is actually taking care of. Anyway, (1) Clink can't make use of that and (2) that stuff doesn't seem to be related to the issue here. |
I've noticed Clink it's quite slow if you type fast, or you move up the history fast. I'm kind of a fast typer so this is a kind of problem to me.
PS: i've tried recording a video where this happens but the video seems normal, no struggling
The text was updated successfully, but these errors were encountered: