-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Implement a more responsive compilation thread in the the language server. #5429
Conversation
fe2512c
to
b9b6ca6
Compare
bfd6eb3
to
acff1b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, great to see this, new architecture looking awesome.
Just a few minor nits.
4078281
to
95022ee
Compare
Thanks for the review @tritao , mem swaps FTW! Should be good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
This PR implements options 2 & 4 from #4706 in order to drastically improve responsiveness to did change events in the server. We now spawn a dedicated compilation thread to respond and process events in parallel. The compiler now periodically checks if the server has requested it bail out to start compilation on a newer event. I've tried to limit the number of places we perform this check to reduce code "noise".
We also clone the
Engines
before compiling and write the result back to theEngines
held by the server on a successful compilation. This is to avoid theEngines
becoming corrupted if the server requests the compiler to bail out early.Some other small changes:
Here are the before and after results when running the
did_change_stress_test
when responding to 400 compilation requests on the benchmark project: 🚀Previously, we had to wait until compilation had finished before we could respond to incoming events. Now that compilation is done in parallel, we can respond to new events (and set the re-trigger compilation flag) as quickly as possible. This leads to a pretty noticeable improvement to the UX when typing in the editor.
closes #4706
Checklist
Breaking*
orNew Feature
labels where relevant.