-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Slow server startup and commands #236
Comments
There are two issues involved here: startup time and server initialization time. Startup time is comparably slow in your benchmarks because the shell loads a lot of components that should not be necessary for simple commands like Server initialization is a bigger issue. One of the most expensive parts of initialization is parsing the workspace. According to my benchmarks, the parser is capable of processing ~1600 lines of code per second. For a 30KLOC workspace, parsing is responsible for about 18 seconds of the initialization time. We might be able to reduce that time with an implementation that uses Switching from Given the amount of work involved, I can't estimate an ETA on progress yet. Nevertheless, improving performance is an ongoing concern, so any suggestions and feedback are appreciated. (Benchmarks were performed on a Windows 10 PC with 32 GB RAM and an 8-core 4.0 GHz CPU.) |
A new commit to master refactors dependency loading to improve startup time. Using It looks like I'll be switching gears on the server initialization issue. I tried a prototype of the parser that uses There's still another option, though. I've been experimenting with |
Version 0.38.0 includes the improvement to base startup speeds. The new RubyVM feature to improve parsing time is still in progress. |
Thanks, will try it out and report on any anomalies! |
The The only major issues I'm seeing are with the type checker, which is still tightly coupled to the AST implementation. |
Current efforts to enhance performance are being tracked in #268. |
Hello @castwide,
First of all thanks for your continued work on this project, it's great to see that Solargraph keeps on improving! 👍
I guess this issue is in essence quite similar to #164. The server seems to take a long time to start up, even for a project with a single Ruby file.
Using Solargraph within Eclipse and observing the requests and responses between the client and the server, it regularly takes over 10 seconds for Solargraph to respond to the first initialize request. It seems equally slow from the command line, when running
solargraph stdio
I only see theSolargraph is listening on stdio PID
message after a few seconds and if my understanding is correct the server is not yet initialised at that point. These poor timings can partly be explained by the fact that my machine has fairly low specifications by today's standards (AMD Quad-Core 2.1 GHz, 8 GB memory, Windows 10, Ruby 2.6.1). However, other language servers take much less time with projects of similar size, the Javascript, Typescript and XML servers available through other Eclipse plugins all take about a second to respond to the initialize request. Code completion and intellisense are provided almost instantly.I guess it's somewhat unfair to compare different servers built using different technologies and targetting different programming language, so I've also looked at performance under a different angle. I noticed that all Solargraph commands generally seemed quite slow in a terminal, so I compared the response times of the
--help
and--version
commands of common gems, as they pretty much all implement these. This time round, I used a higher spec machine (modern Intel Core i7 2.4 GHz, 16GB memory, macOS Mojave, Ruby 2.6.2). I used thetime
command to gather the below figures, averaged on about 5 executions each:Solargraph is significantly slower than other gems for these two cases. I'm no expert when it comes to implementing such commands in gems, but something does not seem quite right.
Thanks for reading and hopefully these observations will be somewhat useful! Let me know if I can provide any more information. 😉
Cheers,
Pyves
The text was updated successfully, but these errors were encountered: