lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Diagnostics run `await.delay()` too often

Open emmericp opened this issue 1 year ago • 1 comments

https://github.com/LuaLS/lua-language-server/pull/2664 got a 25% speed increase by disabling await.delay() for the non-interactive use case.

Many diagnostics call await.delay() for every single ast node they check, so running all diagnostics on a file will probably reschedule the thread more than once per node which is a significant overhead.

I guess fully removing it for the interactive use case isn't a great solution, but maybe there is some kind of middleground like only rescheduling only every n calls?

emmericp avatar May 13 '24 17:05 emmericp

Note: this is likely not directly related to https://github.com/LuaLS/lua-language-server/issues/2660, because that bug is about a slowdown that is way worse than only 25%

emmericp avatar May 13 '24 17:05 emmericp