Skip to content

fix: SG-43079: Optimize time it takes to display thumbnails when we re-display them#1298

Open
deltag0 wants to merge 22 commits into
AcademySoftwareFoundation:mainfrom
deltag0:thumbnail-slowdown-on-update
Open

fix: SG-43079: Optimize time it takes to display thumbnails when we re-display them#1298
deltag0 wants to merge 22 commits into
AcademySoftwareFoundation:mainfrom
deltag0:thumbnail-slowdown-on-update

Conversation

@deltag0

@deltag0 deltag0 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

fix: Optimize time it takes to display thumbnails when we re-display them

Summarize your change.

Instead of blocking the main thread and building the entire session manager from scratch with all thumbnails loaded if it's closed/updated, load thumbnails progressively, letting the main thread handle other events.

Describe the reason for the change.

When loading many files in RV, and closing/opening the session manager, it would freeze the application for an unreasonable amount of time.

Describe what you have tested and on which operating system.

Mac CY2025

List of changes

The goal was that when we open the session manager after all thumbnails are closed, we display the placeholder first, add the task to load the thumbnails in a queue, to run them alongside the main thread. We could also load the first 10 or so thumbnails before opening the session manager to avoid showing a placeholder.

@deltag0 deltag0 marked this pull request as ready for review June 8, 2026 20:30
Comment thread src/plugins/rv-packages/session_manager/session_manager.mu.in Outdated
deltag0 added 16 commits June 12, 2026 16:21
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
@deltag0 deltag0 force-pushed the thumbnail-slowdown-on-update branch from 32242df to f9fe721 Compare June 12, 2026 20:29
SourcePreviewWidget[] _thumbnailHydrationPreviews;
int _thumbnailHydrationIndex;
string[] _thumbnailHydrationDeferred;
QTimer _inputHydrationTimer;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You should encapsulate these variables into a class. Note that classes are supported in Mu.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added this

int _thumbnailHydrationIndex;
string[] _thumbnailHydrationDeferred;
QTimer _inputHydrationTimer;
string[] _inputHydrationQueue;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also: the _thumbnailHydration name is confusing because both the _thumbnailHydration and _inputHydration deal with thumbnails and filmstrips. The _inputHydration is correct since it refers to the inputs. I would rename the _thumbnailHydration to _sourceHydration since it refers to the source nodes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I changed the names

string[] _thumbnailHydrationDeferred;
QTimer _inputHydrationTimer;
string[] _inputHydrationQueue;
SourcePreviewWidget[] _inputHydrationPreviews;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make sure to add some comment above your class to briefly explain what the class actually does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

textLayout.addWidget(nameLabel);

let metaLabel = QLabel(if meta == "" then "—" else meta, textWidget);
let metaLabel = QLabel("—", textWidget);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In your PR, the meta capability is lost : For example, if the media is an mp4 then it should show mp4. Now it is hardcoded to "-"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

QTimer _lazySetInputsTimer;
QTimer _lazyUpdateTimer;
QTimer _mainWinVisTimer;
QTimer _thumbnailHydrationTimer;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The alignment is inconsistant.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

deltag0 added 3 commits June 16, 2026 09:58
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
deltag0 added 2 commits June 16, 2026 15:56
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <victor.terme@autodesk.com>
""";
class: ThumbnailRenderer
{
QTimer _sourceProgressiveRenderTimer;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The _sourceProgressiveRender and the _inputProgressiveRender have the exact same variables. This is what I had in mind when I mentioned that these should be put into a class.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah, I see, added this

Signed-off-by: deltag0 <victor.terme@autodesk.com>
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.

2 participants