-
Notifications
You must be signed in to change notification settings - Fork 24
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
Fix slowness problem on the Electron version #1636
base: master
Are you sure you want to change the base?
Fix slowness problem on the Electron version #1636
Conversation
Nice! 😃 Minor concerns:
|
|
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.
While testing the modifications on the video recording/storing/playing methods, I had the following results:
On Electron:
TEST 1: (Videos recorder on the first Cockpit startup after starting the electron app)
Auto processing:
video 1 - No thumb, not playable
video 2 - No thumb, playble
video 3 - No thumb, not playable
Manual processing:
video 4 - No thumb, playable
video 5 - No thumb, playable
video 6 - No thumb, not playable
video 7 - No thumb, playable
On Electron:
TEST 2: (Rebooted Cockpit keeping the electron app running)
Auto processing:
video 1 - No thumb, playable
video 2 - No thumb, playable
video 3 - No thumb, playable
Manual processing: (after processing videos are not playable right away)
video 4 - thumb while unprocessed, playable only after selecting other video and then this one again
video 5 - thumb while unprocessed, playable only after selecting other video and then this one again
video 6 - thumb while unprocessed, playable only after selecting other video and then this one again
TEST 3: (Cockpit running as web app)
Same results as TEST 2
Main problems are the videos not having thumbs after processed and not being playable right after being processed, needing to be de-selected and re-selected to be playable.
Also Electron performance on first boot wasn't good for video recording. Might be just a coincidence, but half the videos weren't playable.
Below: Video not playable after processing:
Below: Videos not playable after recording on fist Electron app startup:
Will check about on the thumbs problem. About the performance not being good for video recording, can you check memory-usage and fps plots and compare with the same numbers on master? There shouldn't be anything worsening the performance in any case, only the opposite. Also about the thumbs and videos being playable, can you check against master as well? |
Sure, I'll check those |
The video is already in the disk and using this would cause the video to be loaded into memory unnecessarily.
…ents This way, even if the application is closed by an external player, the last known state is preserved.
Test 1 - On Master - Electron Screenshare.-.2025-01-31.2_46_25.PM.mp4Test 2 - On Master - Web app Screenshare.-.2025-01-31.2_56_30.PM.mp4Retesting On Branch - fix-electron-slow Test 1 - Electron App - Using app on first load Screenshare.-.2025-01-31.3_02_40.PM.mp4**Test 2 - Electron App after reloading Screenshare.-.2025-01-31.3_10_26.PM.mp4Test 3 - Web App Only video 6 wasn't playable Screenshare.-.2025-01-31.3_15_14.PM.mp4 |
This prevents unnecessarily loading big video files into memory, which was happening already on the application startup, causing severe performance issues.
As it deals with heavy data, we have to take more care with it, and not load it when not necessary.
Thumbnail was not being stored after the video was processed. The new approach removes the `thumbnail` property from the video file and instead saves a thumbnail file in the storage.
It was not working, as it was trying to remove a file with the name of the hash, and not files that included the hash.
89e88b4
to
350ef54
Compare
There were indeed some caveats into the pipeline! There was no thumbnail stored for processed videos. Thanks for the report! |
This patch performs several changes in order to deal with the performance issue caused by the loading of video files that are in the Cockpit video folder:
I've also removed the download-video-button from the electron version, since the video is already on disk. This also helps directing the user to the folder button, which opens the folder that contains the videos.
After this patch, when the user clicks the video, loading it to memory usually takes less than a second (tested with 0-800MB videos). The memory usage increases during that second but goes away right after.
Electron startup before (top is memory usage in mega bytes, bottom is application frames per second):
After:
Startup and usage after the patch:
Kapture.2025-01-30.at.16.19.30.mp4
Fix #1608