-
Notifications
You must be signed in to change notification settings - Fork 32
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
Extreme inefficiency in main server loop #269
Comments
Could you send a pull request to test? |
This may be a bit more than you asked for, but I've been meaning to open a PR with a collection of improvements I've been working on: #270. With this PR, it's more straightforward to just call If you just want the change that this issue is about, it looks like this: https://github.com/julia-vscode/SymbolServer.jl/compare/master...codedownio:SymbolServer.jl:indexing-perf?expand=1 |
Oh and if you use Nix, I can provide a Nix-based way to test the indexing. |
I was looking at this code in
server.jl
, where it loads the packages one by one, and then every time does a bunch of work over the whole package environment:SymbolServer.jl/src/server.jl
Lines 95 to 100 in 3162b6a
The comment alludes to how this may duplicate some work. It is a bit of an understatement. I was testing with indexing an environment containing only
Plots
and its dependencies, and I tried moving theend
of the loop on line95
up to line97
, so we do all theload_package
calls up front.This made the total indexing time go from 109.1 seconds to 12.2 seconds. Almost a 10X improvement from this one change!
In general, I think the perf of
SymbolServer.jl
has more low-hanging fruit, such as indexing and loading on-disk stores in parallel using multiple threads. I feel that the current painful performance has led to workarounds like the cloud indexing system, which I've never seen before in any other LSP ecosystem and which I really wish didn't exist. (Even more philosophically, I wonder why gobs of symbols need to be indexed and stored in memory up-front at all? Doesn't Julia have the introspection machinery to enableLanguageServer.jl
to look up (and cache as needed) the necessary symbols as it runs?)In my usage at least,
SymbolServer.jl
is the main contributor to slow startup times and high CPU/memory usage when usingLanguageServer.jl
. I think a leaner and meanerSymbolServer.jl
would make life much nicer forLanguageServer.jl
users.CC @mkitti since you were so helpful with the last perf issue I reported. Also CC @davidanthoff.
The text was updated successfully, but these errors were encountered: