Throttle calls to await.delay() in some diagnostics#2680
Merged
sumneko merged 1 commit intoLuaLS:masterfrom May 27, 2024
Merged
Throttle calls to await.delay() in some diagnostics#2680sumneko merged 1 commit intoLuaLS:masterfrom
sumneko merged 1 commit intoLuaLS:masterfrom
Conversation
These 5 diagnostics cause ~70% of all calls to await.delay() by diagnostics which in turn is about ~20% of the total runtime of diagnostics. Out of these diagnostics only assign-type-mismatch commonly exceeds runtimes of 100ms (worst observed in my dataset was 7 seconds) and even then it still attempts to call await.delay() over 1500 times per second, so throttling by a factor of 15 is still fine.
Collaborator
|
The purpose of calling delay is to give the program a chance to respond promptly to user actions. Perhaps using a time-based calculation would be better (but it might incur higher overhead for obtaining the time, which needs to be tested). |
Contributor
Author
|
I understand the idea behind the rescheduling, but it just happens too often. Especially |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These 5 diagnostics cause ~70% of all calls to await.delay() by diagnostics which in turn is about ~20% of the total runtime of diagnostics.
Out of these diagnostics only assign-type-mismatch commonly exceeds runtimes of 100ms (worst observed in my dataset was 7 seconds) and even then it still attempts to call await.delay() over 1500 times per second, so throttling by a factor of 15 is still fine.
There are likely more places where await() could be optimized, but the diagnostics are the low-hanging fruit because they are easy to find.