-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Defer rendering for inactive tabs in Open MCT Tabbed View #7132
Comments
@akhenry I've been fiddling with Intersection Observers, and I think that's the best route. We can use the Screen.Recording.2023-10-16.at.4.39.31.PM.movI'll come up with an API next. |
@akhenry Here's performance before. Note the CPU remains pretty heavy regardless of tab chosen: before.movAnd here's after. Note tabbing to the notebook causes the CPU to plunge and remain low: after.mov |
Complex "Real" Display Test
4 Tab display
|
@akhenry note i split off the webgl stuff into this branch. Should we create another ticket too? |
To test:
|
|
The data I was looking at didn't have a super high data rate, but I did notice a small CPU usage difference when I switched between tabs. Verified Fixed in Testathon on 11/13/23 |
Is your feature request related to a problem? Please describe.
The Open MCT Tabbed View allows users to create displays with multiple complex embedded displays within them. Chrome and other browsers have an optimization that throttles callbacks to
requestAnimationFrame
for inactive browser tabs and we should implement something similar for inactive tabs in an Open MCT Tabbed View.Describe the solution you'd like
An API function that wraps
requestAnimationFrame
and replaces it wherever we are using it in our views. This function would be aware of the visibility of the calling component and only actually call the wrapped RAF callback if the component is in an active tab.Potential means of detecting visibility include:
OR
Let's also use tab visibility awareness to release Web GL contexts from inactive tabs.
Do some experimentation, propose an API, and then let's review the proposal.
The text was updated successfully, but these errors were encountered: