-
Notifications
You must be signed in to change notification settings - Fork 323
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
Only send suggestions updates when type changes #6755
Only send suggestions updates when type changes #6755
Conversation
The change adds an additional field to `ExpressionUpdates` messages sent by `ProgramExecutionSupport` to indicate if the type of value (or its method pointer) has changed and therefore would potentially require a suggestions' update. Prior to #3729 that check was done during the instrumentation. However we still want to continue to support "pending expression" functionality therefore `SuggestionsHandler` will use the additional information to filter only the required expression updates. Most of the changes are related to adapting our tests to the new field. Closes #6707.
Also appears to help slightly with #6639 |
@@ -386,6 +386,7 @@ object ProgramExecutionSupport { | |||
Api.ProfilingInfo.ExecutionTime(e.getNanoTimeElapsed) | |||
}.toVector, | |||
value.wasCached(), | |||
value.isTypeChanged() || value.isFunctionCallChanged(), |
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.
This change + filtering in SuggestionsHandler
is the gist of this PR. The rest is just noise in tests.
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.
Glad that it worked out. One unfortunate thing is that we cannot filter those early in the instrument like it was done originally. But as I understand, we need to propagate them to the language server to handle errors and panics properly.
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.
Yes, sadly
@@ -265,6 +265,7 @@ final class SuggestionsHandler( | |||
updates.map(u => (u.expressionId, u.expressionType)) | |||
) | |||
val types = updates.toSeq | |||
.filter(_.typeChanged) |
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.
That should do the job 👍
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. Tried opening a mid-size project and the number of suggestionsDatabaseUpdate
is lower - before 192 in this PR: 71.
…t-rename * develop: Widgets, Vector as Column, Viz Fixes and Rename Columns (#6768) Implement simple variants of `parse` for the Database backend (#6731) Enable `require-jsdoc` lint and add two lints related to React (#6403) Decimal/Integer .round and .int #6654 (#6743) Set suggestion reexports when serializing the library (#6778) Fix file uploading node expression. (#6689) Using WarningsLibrary to query for warnings (#6751) Implement `cast` for Table and Column (#6711) Display Initializing project... message when initializing project (#6661) Only send suggestions updates when type changes (#6755) sbt runEngineDistribution --debug to ease debuggging (#6745) Display "modified at" column on the cloud dashboard (#6687) Meta.meta Integer . methods (#6740) Show spinner while loading directory (#6714) Add cloud dashboard to changelog (#6688) Fix list editor panics during insertion (#6540) Update bug-report.yml Remove project create form (#6710) Change full-screen visualisation shortcut to shift-space (#6663)
* develop: (30 commits) Widgets, Vector as Column, Viz Fixes and Rename Columns (#6768) Implement simple variants of `parse` for the Database backend (#6731) Enable `require-jsdoc` lint and add two lints related to React (#6403) Decimal/Integer .round and .int #6654 (#6743) Set suggestion reexports when serializing the library (#6778) Fix file uploading node expression. (#6689) Using WarningsLibrary to query for warnings (#6751) Implement `cast` for Table and Column (#6711) Display Initializing project... message when initializing project (#6661) Only send suggestions updates when type changes (#6755) sbt runEngineDistribution --debug to ease debuggging (#6745) Display "modified at" column on the cloud dashboard (#6687) Meta.meta Integer . methods (#6740) Show spinner while loading directory (#6714) Add cloud dashboard to changelog (#6688) Fix list editor panics during insertion (#6540) Update bug-report.yml Remove project create form (#6710) Change full-screen visualisation shortcut to shift-space (#6663) Revert "Show spinner when opening/creating a project (#6321)" (#6712) ...
Only invalidate the graph editor view at most once per frame. On develop, this saves about 70ms (2%). Testing a recent backend without #6755 as a stress-test, this saves about 5s (45%). This reflects better scalability to large numbers of `SuggestionUpdate` messages. Fixes #6630. # Important Notes - Also fix intermittent profiling failures occurring since the introduction of microtasks.
Pull Request Description
The change adds an additional field to
ExpressionUpdates
messages sent byProgramExecutionSupport
to indicate if the type of value (or its method pointer) has changed and therefore would potentially require a suggestions' update.Prior to #3729 that check was done during the instrumentation. However we still want to continue to support "pending expression" functionality therefore
SuggestionsHandler
will use the additional information to filter only the required expression updates.Most of the changes are related to adapting our tests to the new field.
Closes #6706.
Important Notes
The associated project now loads and navigates smoothly.
Also attaching a screenshot from the project that illustrates that pending functionality continues to work:
Kazam_screencast_00006.webm
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
[ ] The documentation has been updated, if necessary.Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.