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

[Tech Debt] Refactor Lang Server cache #167

Closed
glennsarti opened this issue Aug 22, 2019 · 0 comments · Fixed by #166
Closed

[Tech Debt] Refactor Lang Server cache #167

glennsarti opened this issue Aug 22, 2019 · 0 comments · Fixed by #166
Labels
enhancement New feature or request
Milestone

Comments

@glennsarti
Copy link
Contributor

Currently the caching in the Language Server creates and destroys a lot of objects, in particular converting sidecar objects into cache objects, which is basically the same thing with a little decoration.

This object creation/deletion, isn't really needed and causes undue GC stress. We should refactor it to use the SideProtocol objects directly.

@glennsarti glennsarti added this to the 0.21.0 milestone Aug 22, 2019
@glennsarti glennsarti added the enhancement New feature or request label Aug 22, 2019
glennsarti added a commit to glennsarti/puppet-editor-services that referenced this issue Aug 22, 2019
Previously the caching in the Language Server created and destroyed a lot of
objects, in particular converting sidecar objects into cache objects, which is
basically the same thing with a little decoration. This object creation/deletion
isn't really needed and causes undue GC stress.

This commit:
* Changes the cache to use the Sidecar Protocol Objects directly which stops the
  needless creation and destruction of objects
* Instead of adding the `origin` method to all cache objects, this commit uses
  hashtable "buckets" to remember which sections and and origins objects should
  be categorised as
* Removes the PuppetHelper.all_objects method as it needlessly yields yeilded
  objects. Instead callers can use the cache directly
* Removes the cache_objects source file and tests
* Adds helpful frozen arrays in the cache class for valid sections and origins,
  although this is not yet enforced
* Begins to change the providers to use the object cache as a parameter instead
  of through the PuppetHelper module.  This is easier for testing.
* Updates the completion, document_symbol and hover provider with the new cache
  object types and method removals.
glennsarti added a commit that referenced this issue Aug 22, 2019
(GH-167) Refactor Language Server inmemory caching
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant