fix: SG-43079: Optimize time it takes to display thumbnails when we re-display them#1298
fix: SG-43079: Optimize time it takes to display thumbnails when we re-display them#1298deltag0 wants to merge 22 commits into
Conversation
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>
32242df to
f9fe721
Compare
| SourcePreviewWidget[] _thumbnailHydrationPreviews; | ||
| int _thumbnailHydrationIndex; | ||
| string[] _thumbnailHydrationDeferred; | ||
| QTimer _inputHydrationTimer; |
There was a problem hiding this comment.
You should encapsulate these variables into a class. Note that classes are supported in Mu.
| int _thumbnailHydrationIndex; | ||
| string[] _thumbnailHydrationDeferred; | ||
| QTimer _inputHydrationTimer; | ||
| string[] _inputHydrationQueue; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
I changed the names
| string[] _thumbnailHydrationDeferred; | ||
| QTimer _inputHydrationTimer; | ||
| string[] _inputHydrationQueue; | ||
| SourcePreviewWidget[] _inputHydrationPreviews; |
There was a problem hiding this comment.
Make sure to add some comment above your class to briefly explain what the class actually does.
| textLayout.addWidget(nameLabel); | ||
|
|
||
| let metaLabel = QLabel(if meta == "" then "—" else meta, textWidget); | ||
| let metaLabel = QLabel("—", textWidget); |
There was a problem hiding this comment.
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 "-"
| QTimer _lazySetInputsTimer; | ||
| QTimer _lazyUpdateTimer; | ||
| QTimer _mainWinVisTimer; | ||
| QTimer _thumbnailHydrationTimer; |
There was a problem hiding this comment.
The alignment is inconsistant.
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>
| """; | ||
| class: ThumbnailRenderer | ||
| { | ||
| QTimer _sourceProgressiveRenderTimer; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Ah, I see, added this
Signed-off-by: deltag0 <victor.terme@autodesk.com>
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.