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

Puncture the bloat balloon #807

Merged
merged 7 commits into from
Oct 12, 2024

Conversation

SamCarlberg
Copy link
Member

@SamCarlberg SamCarlberg commented Jun 20, 2024

Overview

Removes various sources of high CPU usage:

  • The live network table preview has been removed due to the high frequency of node redraws. Spot checking data will now need to be done by dragging a data widget into a tab. Generic table data should still be displayable with the generic tree table widget. The NT source preview now displays the data type of a topic instead of its current value.
  • The subscribe-to-all-NT-data behavior has been changed to only subscribe to topic information. This should cut down on bandwidth and some CPU usage
  • The widget gallery has been removed with no replacement. Drawing the large number of dummy widgets took a surprising CPU load and occasionally caused problems at startup when third party widgets from plugins would crash

And some bug fixes:

  • Fixes widgets getting permanently disabled after network disconnects
    • This was caused by the placeholder destroyed sources not always being removed when restored, causing the widget to think it still had a disconnected data source

The widget gallery is removed with no replacement.

Live network table value previews are removed. Data must now be viewed only in a widget. This removes unnecessary subscriptions to unused fields (saving network bandwidth) and removes a high-frequency updating pane that is often hidden, which resulted in unnecessarily high CPU usage
NT sources do not provide their current values
@Starlight220
Copy link
Member

How coupled are these changes? I think it'd be better to split it into different PRs.

@SamCarlberg
Copy link
Member Author

How coupled are these changes? I think it'd be better to split it into different PRs.

The live NT preview and widget gallery changes are both resulting from profiling the JavaFX scene graph. The NT subscribe-to-all change naturally falls out of that, since there's no need to have subscriptions that are never used

Widgets were getting destroyed sources added, but weren't replacing the backing NT source. These widgets would be permanently disabled and would need to be deleted and recreated, or a dashboard application restart, to be usable again

Topics written to by the dashboard would not receive "unpublish" events from the server, so they'd always be active and available. The `allUris` observable list was incorrectly adding/removing entries so URIs for those topics could still be removed from the list (disabling connected widgets with a destroyed source) if those URIs happened to be at the same index in the `allUris` list as a removed item in the plugin's URI list

Topics written to by the dashboard would not receive a "publish" event from the server on reconnect, so no data sources would be created for them. We now manually trigger the data source creation logic for every topic that still exists in the NT client upon a server reconnect to ensure those sources are recreated
@SamCarlberg SamCarlberg marked this pull request as ready for review September 19, 2024 01:01
@TheTripleV
Copy link
Member

Live NT preview is pretty popular. Should Shuffleboard get a pinned message at the top of the tree view pane saying to use AdvantageScope for this?

@PeterJohnson PeterJohnson merged commit cdd5e7a into wpilibsuite:main Oct 12, 2024
9 checks passed
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.

4 participants