Opened 15 years ago
Closed 15 years ago
Last modified 15 years ago
#7953 closed patch (fixed)
Reduce mythfrontend CPU usage on idle screens
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | major | Milestone: | 0.23 |
Component: | MythTV - General | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | yes |
Description
Many people have observed that mythfrontend consumes a surprising amount of CPU time while sitting idle on a screen even as simple as the main menu. The reported CPU usage is usually either 7% or 14%. This is due to the QTimer implementation which is used for the 70Hz MythMainWindowPrivate::drawTimer. To get the best possible precision, QTimer may spend the last 1-2ms busy-waiting before the timeout signal.
This excess CPU usage can be a real issue for a combined FE/BE machine. Also, it adds to the CPU requirements during playback because the drawTimer is not stopped during playback.
The attached patch uses a simple timer class based on usleep(). On my ION system, idle frontend CPU usage drops from 7% to around 1%, according to "top".
Attachments (2)
Change History (7)
Changed 15 years ago by
Attachment: | reduce_idle_cpu_usage.patch added |
---|
comment:1 Changed 15 years ago by
Milestone: | unknown → 0.23 |
---|---|
Priority: | minor → major |
Version: | unknown → head |
comment:2 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [23304]) Fixes #7953. Reduce CPU usage in MythUI by 70 ms per second by using a replacement timer class.
Note: I'm hoping this can be fixed upstream quickly so we can eventually get rid of this workaround. This is appears to be the root cause for a number of lost cycles on my laptop's KDE desktop.
comment:3 follow-up: 4 Changed 15 years ago by
I noticed the upstream QTimer bug has been marked fixed for QT 4.6.x, and newer distributions like Ubuntu Lucid are shipping QT 4.6.x. Can we try going back to a QTimer and see what the CPU usage is?
comment:4 Changed 15 years ago by
Replying to anonymous:
I noticed the upstream QTimer bug has been marked fixed for QT 4.6.x, and newer distributions like Ubuntu Lucid are shipping QT 4.6.x. Can we try going back to a QTimer and see what the CPU usage is?
Specifically: http://bugreports.qt.nokia.com/browse/QTBUG-7618
comment:6 Changed 15 years ago by
Ticket locked: | set |
---|
Nokia failed to understand the problem and their fix doesn't actually deal with the issue. So no, we can't go back to QTimer
Also, Trac is a not a discussion forum.
Not sure if this exact solution will be implemented, but if this reduces CPU usage while idle, it will definitely be looked at before 0.23.