Skip to content

Fix world's slowest stack overflow - #123

Merged
julienduchesne merged 2 commits into
mainfrom
julienduchesne/fix-slow-stackoverflow
Aug 29, 2023
Merged

julienduchesne merged 2 commits into
mainfrom
julienduchesne/fix-slow-stackoverflow

Conversation

@julienduchesne

@julienduchesne julienduchesne commented Aug 29, 2023 •

Copy link
Copy Markdown
Contributor

When dealing with CRDsonnet libraries in our (Grafana Labs) repositories, the language server would lock up and use up all my CPU:

  • I thought it had something to do with CRDsonnet but I was wrong.
  • This happened because it was trying to find a field in the wrong nodestack repeatedly (see image). It didn't crash because it didn't loop quick enough?
  • This PR fixes the issue.
  • Obviously, the language server can't find fields that come from processing jsonschema, but at least it doesn't take up 4 full CPUs (it reached 1% CPU usage while testing :) )

image

When dealing with CRDsonnet libraries in our (Grafana Labs) repositories, the language server would lock up:

- I thought it had something to do with CRDsonnet but I was wrong.
- This happened because it was trying to find a field in the wrong nodestack repeatedly (see image)
- This PR fixes the issue.
- Obviously, the language server can't find fields that come from processing jsonschema, but at least it doesn't take up 4 full CPUs (it reached a full 1% CPU usage while testing :) )
All tests are still passing. `$` can be resolved across multiple files, so I guess the language server is just better now and doesn't need that safety
If this causes a bug, we should add a new test
@julienduchesne
julienduchesne marked this pull request as ready for review August 29, 2023 02:38
@julienduchesne
julienduchesne merged commit a23b945 into main Aug 29, 2023
@julienduchesne
julienduchesne deleted the julienduchesne/fix-slow-stackoverflow branch August 29, 2023 12:10
@zalegrala

Copy link
Copy Markdown

😌

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants