-
-
Notifications
You must be signed in to change notification settings - Fork 341
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
Increased time to first diagnostic/language server initialization with 1.14.2 #386
Comments
Same here (Intel macOS); last good version (no error, instant response on startup) was 1.12.0 (despite the hang in the test); going back to 1.13.0 already shows the error, but the timeout is much quicker (only a few seconds). |
I cannot reproduce this in my computer(Windows 10). |
No, I assume this is something specific to macOS (and possibly neovim); otherwise I'd have expected someone to have already reported this days ago ;) So there are two regressions here:
The second issue may indeed be caused by that commit, but 1. seems to have a different cause. I'll try to bisect it in the next hours. |
This is not an error, but some large files were skipped for performance. You can control this size in the settings, the default is 100k. Perhaps in a certain version, your project has files that just exceed the threshold. |
Sorry, "warning" would have been better. Nevertheless, this did not occur previously, and I got instant diagnostics/completions. (Not complaining, mind you -- there's probably a good reason for it! Just trying to understand what is happening and how to get back the old behaviour.) |
Oh, relax, I didn't feel any discomfort. My wording and tone may be a bit strange, it is all the fault of Google Translate. I'm just worried that you might have misunderstood this prompt, so I explained it a little bit. |
No problem, I just wanted to make sure -- as you write, it's always better to explain! So I bisected and, not surprisingly, got 43a29d8 as the first bad commit. I started from 1.12.2, which does give a tip, but it's a different one:
I also get completions before this hint appears. (The message changes over the next few commits, offering actions, as you know.) |
It seems that your project needs to get more lua scripts through other means. In my test, there were only more than 400 lua files in the work area, so it seemed that the initialization was completed quickly. Due to the need to calculate global variables and require references, the correct approach is indeed to wait for the initialization to complete before responding to operations such as automatic completion. However, considering the following two reasons, in the previous version, I allowed to respond before the initialization was completed:
But then the situation changed, so I changed to wait for the initialization to complete:
|
Thank you for the explanation, that makes sense. So the wait is needed to guarantee correct results, and the only issue is that -- at least on macOS -- increasing the One thing that is still a bit confusing is that I also have to wait 30s for diagnostics if I open a new file |
Please send me the log and see what I am doing in these 30 seconds. In addition, please help test it, manually change 0.01 second back to 0.001 second result |
Sure! Here's the logs from an empty test file for an empty directory (it seems it's still indexing the |
And, yes, decreasing the |
This log shows that initialization was completed in 0.4 seconds and only 12 meta files were loaded.
But it doesn't seem to matter anymore. The problem is that the behavior of sleep on the macOS platform is more complicated than I thought. This problem is indeed caused by 723f3d2 (increasing the initialization time from 3 seconds to 30 seconds), and 43a29d8 exposed the problem (need to wait for the initialization to complete before responding). I will temporarily change sleep back to 0.001 seconds, and then use #329 (comment) to completely solve the problem. |
I'm really sorry to say this, but since 1.15 I no longer get any diagnostics or completion (both on macOS and Linux). (CPU time is at 0% now, though...) Log files: |
Oh, I'm in holiday in next 7 days, have no machine to debug this. |
No worries, happy Lunar New Year! Version 1.14.3 works well (not too long delay, and not too much CPU use). |
EDIT: I found this: https://stackoverflow.com/questions/27178789/c-different-implementation-of-clock-in-windows-and-other-os. I will use other methods to achieve related functions. |
@clason I have fixed it, please check out and test it, thank you! |
Fixes the problem for me! |
Yes, works really smoothly now. Thank you! |
What about Linux and macos? |
Describe the bug
@clason and I noticed an increase in time to first diagnostic on macOS for 1.14.2. It used to provide diagnostics almost instantly on a file, but now it seems to take approximately 30 seconds before giving some timeout messages
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Prior to 723f3d2 diagnostics were pretty much instant. This commit does reduce CPU usage though at idle, which is great.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: