-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
When menu is open, CPU thread congestion from Vue causes choppy video and frame drop every second #159
Comments
I think this is triggered as part of the UI updating the stats (especially because RTCPeerConnection.getStats is in the mix) and everything else that gets periodically updated in the menus. The CPU spike is completely eliminated when the stats update is disabled. |
The core issue seems to be that each of these variables are linked to a Vue element and it's generating massive numbers of render ticks. selkies-gstreamer/addons/gst-web/src/app.js Lines 466 to 510 in ff0ba43
|
Honestly, I have never imagined DOM updates could be so taxing. Disabled DOM updates when the menu is not open (It's not possible to interactively control anything anyways with the menu open). However, it feels like reactive libraries should not be used in the same place and perhaps |
NOTE: This has been partially fixed so that this will not affect the stream as long as the side menu is closed.
The above spike in CPU usage every second represents a stutter/frame drop that exists exclusively with lower power mode (Windows, for example) in clients, which gets better when the highest power mode (and thus a higher ceiling in CPU clock).
It becomes worse if the stream is actively moving.
Interestingly, the heap either notably increases or sharply decreases during that spike.
The source of this issue is from Vue, where the microtasks every second originate with nextTick, flushCallbacks, flushSchedulerQueue, Watcher.run, Watcher.get, updateComponent, Vue._update, Vue._render, patch, render, normalizeScopedSlots, patchVnode, etc... from vue.js, causes massive lag in the WebRTC video element.
However, this could be a result of our own code components, which would be less concerning than requiring an overhaul in the web interface or a major update in the libraries.
Also note that ff0ba43 is another source that contributes to elevated CPU clocks which must be optimized, but this is separate where the elevated CPU usage is distributed across the whole timeframe and not a brief and sharply blocking CPU spike every second.
Designating as a blocker for project release and a high-priority issue.
The text was updated successfully, but these errors were encountered: