-
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
Coalesce graph editor view invalidations #6786
Conversation
.then(move || { | ||
on_before_rendering.emit(time_info); | ||
drop(_profiler); | ||
}) |
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.
Is it intentional? Just making sure, as I don't know this part, and this change wasn't in PR's description.
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.
Thanks for noticing--fixed the description.
A question – why does it fix #6630? Was that regression introduced by invalidating the graph editor multiple times per frame and this PR fixes that, or something else happened? |
I'll have a look at the increased cost of view initialization when #6630 started and see if there's much room for improvement there. |
We're spending 14% (475ms) of While I'm sure we could do better than 7ms per tree, this project only has 12 nodes. We shouldn't need to build 64 widget trees to open it. #6802 will probably help with this: When graph execution changes the data attached to |
Actually, widget rebuild is already incremental via a |
@kazcw About the widget updates, I don't think that the amount of updates here is in any way alarming. And as you noticed, most of those updates should indeed be done incrementally, due to stable identities. The problem is that creating UI components in general is very expensive right now, partly due to the overhead of creating the display object hierarchy and each component's FRP network (to be more specific, due to the huge amount of tiny allocations needed to do that). I expect that this will improve drastically with the upcoming FRP changes. Separating the SpanTree (or expression data in general) from execution context data won't necessarily improve the situation, because the work to update the widgets fundamentally has to happen anyway. We would just have two separate streams of data that the tree has to react to. Also, due to how the node expression update is handled, updates with unchanging span tree actually shouldn't even cause the widget tree to be rebuilt. Those unchanged updates are rejected at the graph presenter level. enso/app/gui/src/presenter/graph/state.rs Line 464 in fe0a06d
Interestingly, the way this is checked is another area for improvement. Building the span-trees only to deep compare them and figure out nothing changed is incredibly wasteful. |
QA Report: 🔴Detaching connections going to self port from their source and connecting to another source triggers weird behavior: qa-graph-updates-2023-05-26_16.32.53.mp4Often I cannot connect to this self port afterward. Now, I have actually seen the same issue on the develop once, but in this PR it became 100% reproducible. |
@farmaazon can you re-upload the video? |
Done. Sorry, I missed it hadn't uploaded. |
That is #6772, which I don't think is intermittent, except for some timing-sensitivity. It depends on: The target node and port (typically detaching a port that is the receiver of a method, as in your example, causes it), and how long the edge is detached (it breaks when the graph re-evaluates). In a graph similar to your example, I can reproduce it 100% of the time on |
You are right, it's far more reducible on develop than I've seen during my QA (perhaps I was just lucky). So **the QA turns 🟢 ** |
…le-6756-6804 * develop: (22 commits) Coalesce graph editor view invalidations (#6786) Append warnings extracted before tail call execution (#6849) Detect and override hooks of the same kind (#6842) Dynamic app resampling and better performance measurements. (#6595) Show spinner when opening/creating a project, take #2 (#6827) Infrastructure for testing inter project imports and exports (#6840) Only initialise visualisation chooser if it is used. (#6758) Allow casting a Mixed column into a concrete type (#6777) Stop graph editing when in full-screen visualization mode (#6844) Handle `show-dashboard` event (#6837) Fix some dashboard issues (#6668) Fix JWT leak (#6815) Fix "set username" screen (#6824) Fallback to opened date when ordering projects (#6814) Various test improvements to increase coverage and speed things up (#6820) do not activate nested dropdowns together (#6830) Clearly select single specialization with enum dispatch pattern (#6819) Prevent incorrect application of list widget on incompatible expressions (#6771) Update GraalVM to 22.3.1 JDK17 (#6750) Import/export syntax error have more specific messages (#6808) ...
Pull Request Description
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
Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
The documentation has been updated, if necessary.Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
Unit tests have been written where possible../run ide build
.