Drop use of ControlObjectThread->get() in performance-sensitive code
Bug #1088227 reported by
Owen Williams
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Low
|
Owen Williams |
Bug Description
Calls to ControlObject ->get() have a lot of overhead, so instead of using get() on every render pass, instead we should bind a slot to the ValueChanged signal so that the value only updates when the control object changes.
and I have stats!
Before:
Debug [Main]: Stat("WaveformW
After:
Debug [Main]: Stat("WaveformW
there are lots more opportunities to get rid of get() calls, but this is a start.
Related branches
Changed in mixxx: | |
status: | New → In Progress |
Changed in mixxx: | |
importance: | Undecided → Low |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Wow, that saves a lot.
This is a simple solution suitable for 1.11. Thank you.
For later versions I would prefer to have a general solution.
Current code: read::get( ) { .lock() ; .unlock( );
double ControlObjectTh
m_dataMutex
double v = m_dValue;
m_dataMutex
return v;
}
for 64 bit architecture we can simply write it like this: read::get( ) {
inline double ControlObjectTh
return m_dValue;
}
because reading and writing a double is an atomic 64 bit operation
For 32 bit architectures we should consider if float precision is exact enough for some (most) read::get( ) {
control objects so we can do it like that
inline float ControlObjectTh
return m_dValue;
}