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

Improve the UX of the Arduino language server #1255

Merged
merged 3 commits into from
Aug 1, 2022
Merged

Improve the UX of the Arduino language server #1255

merged 3 commits into from
Aug 1, 2022

Conversation

kittaakos
Copy link
Contributor

@kittaakos kittaakos commented Jul 26, 2022

Motivation

The LS is still slow according to users.

Change description

Other information

Closes #1244
Closes #1062
Closes #1191

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server labels Jul 26, 2022
@kittaakos kittaakos force-pushed the #714-vol2 branch 5 times, most recently from f2a6ae6 to 7ff8a2c Compare July 28, 2022 09:28
@kittaakos kittaakos marked this pull request as ready for review July 28, 2022 15:59
@kittaakos
Copy link
Contributor Author

@per1234 and @ubidefeo,

I am marking this PR ready for review, but I will also verify it locally. This PR took so long. I had some issues with #1263, but it turned out to be a board-specific problem.

Please note that there is a significant behavior change besides some speedup here and there: the problem decorators arrive in the editor 500ms after finishing the typing. So please expect some latency. Maybe "never arriving decorators" until the next keypress event. 😬 I am curious what you think about it. Based on my profiling results, the tweaks should help the frontend.

I do not know if the proposed changes solve the indexing/building performance issue (#714). I could not reproduce it on my Windows env, but all profiling and adjustments were implemented and verified on that machine. So I hope this will improve the overall LS experience in IDE2.

Please help with testing the review so we can involve the users as soon as possible. Thank you!

@davegarthsimpson
Copy link
Contributor

davegarthsimpson commented Jul 29, 2022

@kittaakos

Maybe "never arriving decorators" until the next keypress event

Why might they never arrive until next keypress?

@kittaakos
Copy link
Contributor Author

Why might they never arrive until next keypress?

Timing.

Copy link
Contributor

@davegarthsimpson davegarthsimpson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code-wise good for me, great work!

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This provides a very significant performance improvement.

Even though I don't experience the extraordinary resource usage to the level of impact and duration reported at #714, if I type many characters very quickly (beyond what would be expected for real world usage) when using the latest build from the main branch (2.0.0-rc9-snapshot-55927ac), I do see a significant spike in CPU and memory usage of the Arduino IDE process with the --type=renderer flag, which persists for longer than expected (~30 seconds) before finally subsiding back to the IDE's normal base resource usage levels.

When using the build from this PR, I do not see this significant and tenacious increase in the resource consumption of that process under the same conditions.

The slightly increased "squiggle latency" does not bother me at all.

Thanks Akos!

Akos Kitta added 3 commits August 1, 2022 09:21
 - Debounced the connectivity status update.
 - Silent the output channel for the Arduino LS.
 - Delay the problem markers update with 500ms.
 - Do not update the status bar on every `keypress` event.
 - Debounced the tab-bar toolbar updates when typing in editor.
 - Fixed electron menu contribution binding.
 - Aligned the editor widget factory's API to Theia.
 - Set the zoom level when the app is ready (Closes #1244)
 - Fixed event listener leak (Closes #1062)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself topic: language server Related to the Arduino Language Server type: enhancement Proposed improvement
Projects
None yet
3 participants