Skip to content
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

Performance Improvements #268

Closed
castwide opened this issue Jan 27, 2020 · 1 comment
Closed

Performance Improvements #268

castwide opened this issue Jan 27, 2020 · 1 comment

Comments

@castwide
Copy link
Owner

The v0.39 branch introduces several enhancements that should noticeably improve performance, especially the language server's startup time.

Cached YARD Gems

Solargraph generates serialized caches for the Ruby core, the stdlib, and external gems. This eliminates the need to process yardocs every time the server initializes a workspace.

Reduced Map Size

Pins (the objects that comprise code maps) no longer store copies of their corresponding YARD objects. On average, this reduces memory consumption by 25-30%.

RubyVM Parsing

Solargraph on Ruby 2.6+ uses the core RubyVM library to parse workspace code. In my benchmarks, it's about 5 times faster than the Parser gem. Ruby < 2.6 falls back to Parser.

Comment Ripping

All versions of Ruby use Ripper to extract comments from workspace code.

Other Notes

  • The serialized YARD maps should be mostly stable, but if an update introduces a breaking change, you might need to run solargraph clear to reset the cache.
  • The v0.39 branch also includes the type checker updates being tracked in Static type checker #192.
@castwide
Copy link
Owner Author

Released in v0.39.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant