Using the outline skin on Debian 5.0, I see mixxx consuming 13 % CPU,
and xorg 32% even when there's no visual change.
Digging a little on the performance issues mentioned in the wiki, I
found that preventing ControlObject from changing unchanged values does
the trick, see attached trivial patch against trunk. It reduces xorg CPU
usage to a minimum when there's no display update.
As soon as I play, the cpu usage rises again (mostly in xorg, caused by
wVuMeter updates), which I reduced drastically by using repaint()
instead of update() in WWidget::setValue().
Regards,
Andreas
Index: widget/wwidget.cpp
===================================================================
--- widget/wwidget.cpp (revision 2748)
+++ widget/wwidget.cpp (working copy)
@@ -132,7 +132,7 @@
void WWidget::setValue(double fValue)
{
m_fValue = fValue;
- update();
+ repaint();
}
void WWidget::setOnOff(double d)
Index: controlpotmeter.cpp
===================================================================
--- controlpotmeter.cpp (revision 2748)
+++ controlpotmeter.cpp (working copy)
@@ -87,6 +87,8 @@
void ControlPotmeter::setValueFromThread(double dValue)
{
+ if (dValue == m_dValue) return;
+
if (dValue>m_dMaxValue)
m_dValue = m_dMaxValue;
else if (dValue<m_dMinValue)
Index: controlobject.cpp
===================================================================
--- controlobject.cpp (revision 2748)
+++ controlobject.cpp (working copy)
@@ -165,12 +165,16 @@
void ControlObject::setValueFromThread(double dValue)
{
+ if (m_dValue == dValue) return;
+
m_dValue = dValue;
emit(valueChanged(m_dValue));
}
void ControlObject::set(double dValue)
{
+ if (m_dValue == dValue) return;
+
setValueFromEngine(dValue);
m_sqQueueMutexChanges.lock();
m_sqQueueChanges.enqueue(this);
@@ -179,6 +183,8 @@
void ControlObject::add(double dValue)
{
+ if (!dValue) return;
+
setValueFromEngine(m_dValue+dValue);
m_sqQueueMutexChanges.lock();
m_sqQueueChanges.enqueue(this);
@@ -187,6 +193,8 @@
void ControlObject::sub(double dValue)
{
+ if (!dValue) return;
+
setValueFromEngine(m_dValue-dValue);
m_sqQueueMutexChanges.lock();
m_sqQueueChanges.enqueue(this);
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel