Commit 164a71e8 authored by sletz's avatar sletz
Browse files

Tim Blechmann optimization patch (inlining some heavy used methods).

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3447 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 52417e69
......@@ -22,7 +22,11 @@ Torben Hohn
---------------------------
Jackdmp changes log
---------------------------
---------------------------
2009-03-19 Stephane Letz <letz@grame.fr>
* Tim Blechmann optimization patch (inlining some heavy used methods).
2009-03-12 Stephane Letz <letz@grame.fr>
......
......@@ -83,11 +83,6 @@ bool JackConnectionManager::IsLoopPathAux(int ref1, int ref2) const
// External API
//--------------
int JackConnectionManager::GetActivation(int refnum) const
{
return fInputCounter[refnum].GetValue();
}
/*!
\brief Connect port_src to port_dst.
*/
......
......@@ -440,7 +440,12 @@ class SERVER_EXPORT JackConnectionManager
void DirectConnect(int ref1, int ref2);
void DirectDisconnect(int ref1, int ref2);
int GetActivation(int refnum) const;
int GetActivation(int refnum) const
{
return fInputCounter[refnum].GetValue();
}
// Graph
void ResetGraph(JackClientTiming* timing);
......
......@@ -33,44 +33,6 @@ static inline jack_time_t JACK_MAX(jack_time_t a, jack_time_t b)
return (a < b) ? b : a;
}
void JackEngineControl::CycleIncTime(jack_time_t callback_usecs)
{
// Timer
fFrameTimer.IncFrameTime(fBufferSize, callback_usecs, fPeriodUsecs);
}
void JackEngineControl::CycleBegin(JackClientInterface** table,
JackGraphManager* manager,
jack_time_t cur_cycle_begin,
jack_time_t prev_cycle_end)
{
fTransport.CycleBegin(fSampleRate, cur_cycle_begin);
CalcCPULoad(table, manager, cur_cycle_begin, prev_cycle_end);
#ifdef JACK_MONITOR
fProfiler.Profile(table, manager, fPeriodUsecs, cur_cycle_begin, prev_cycle_end);
#endif
}
void JackEngineControl::CycleEnd(JackClientInterface** table)
{
fTransport.CycleEnd(table, fSampleRate, fBufferSize);
}
void JackEngineControl::InitFrameTime()
{
fFrameTimer.InitFrameTime();
}
void JackEngineControl::ResetFrameTime(jack_time_t cur_cycle_begin)
{
fFrameTimer.ResetFrameTime(fSampleRate, cur_cycle_begin, fPeriodUsecs);
}
void JackEngineControl::ReadFrameTime(JackTimer* timer)
{
fFrameTimer.ReadFrameTime(timer);
}
void JackEngineControl::CalcCPULoad(JackClientInterface** table,
JackGraphManager* manager,
jack_time_t cur_cycle_begin,
......@@ -126,9 +88,4 @@ void JackEngineControl::NotifyXRun(float delayed_usecs)
fMaxDelayedUsecs = delayed_usecs;
}
void JackEngineControl::ResetXRun()
{
fMaxDelayedUsecs = 0.f;
}
} // end of namespace
......@@ -119,18 +119,48 @@ struct SERVER_EXPORT JackEngineControl : public JackShmMem
{}
// Cycle
void CycleIncTime(jack_time_t callback_usecs);
void CycleBegin(JackClientInterface** table, JackGraphManager* manager, jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end);
void CycleEnd(JackClientInterface** table);
void CycleIncTime(jack_time_t callback_usecs)
{
// Timer
fFrameTimer.IncFrameTime(fBufferSize, callback_usecs, fPeriodUsecs);
}
void CycleBegin(JackClientInterface** table, JackGraphManager* manager, jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end)
{
fTransport.CycleBegin(fSampleRate, cur_cycle_begin);
CalcCPULoad(table, manager, cur_cycle_begin, prev_cycle_end);
#ifdef JACK_MONITOR
fProfiler.Profile(table, manager, fPeriodUsecs, cur_cycle_begin, prev_cycle_end);
#endif
}
void CycleEnd(JackClientInterface** table)
{
fTransport.CycleEnd(table, fSampleRate, fBufferSize);
}
// Timer
void InitFrameTime();
void ResetFrameTime(jack_time_t callback_usecs);
void ReadFrameTime(JackTimer* timer);
void InitFrameTime()
{
fFrameTimer.InitFrameTime();
}
void ResetFrameTime(jack_time_t callback_usecs)
{
fFrameTimer.ResetFrameTime(fSampleRate, callback_usecs, fPeriodUsecs);
}
void ReadFrameTime(JackTimer* timer)
{
fFrameTimer.ReadFrameTime(timer);
}
// XRun
void NotifyXRun(float delayed_usecs);
void ResetXRun();
void ResetXRun()
{
fMaxDelayedUsecs = 0.f;
}
// Private
void CalcCPULoad(JackClientInterface** table, JackGraphManager* manager, jack_time_t cur_cycle_begin, jack_time_t prev_cycle_end);
......
......@@ -73,7 +73,7 @@ class SERVER_EXPORT JackTimer
\brief A class using the JackAtomicState to manage jack time.
*/
class JackFrameTimer : public JackAtomicState<JackTimer>
class SERVER_EXPORT JackFrameTimer : public JackAtomicState<JackTimer>
{
private:
......
......@@ -101,11 +101,6 @@ int JackGraphManager::SuspendRefNum(JackClientControl* control, JackSynchro* tab
return manager->SuspendRefNum(control, table, fClientTiming, usec);
}
JackClientTiming* JackGraphManager::GetClientTiming(int ref)
{
return &fClientTiming[ref];
}
// Server
void JackGraphManager::DirectConnect(int ref1, int ref2)
{
......
......@@ -120,7 +120,11 @@ class SERVER_EXPORT JackGraphManager : public JackShmMem, public JackAtomicState
int ResumeRefNum(JackClientControl* control, JackSynchro* table);
int SuspendRefNum(JackClientControl* control, JackSynchro* table, long usecs);
JackClientTiming* GetClientTiming(int refnum);
JackClientTiming* GetClientTiming(int refnum)
{
return &fClientTiming[refnum];
}
void Save(JackConnectionManager* dst);
void Restore(JackConnectionManager* src);
......
......@@ -86,12 +86,6 @@ int JackTransportEngine::SetTimebaseMaster(int refnum, bool conditionnal)
}
}
void JackTransportEngine::GetTimebaseMaster(int& refnum, bool& conditionnal)
{
refnum = fTimeBaseMaster;
conditionnal = fConditionnal;
}
// RT
bool JackTransportEngine::CheckAllRolling(JackClientInterface** table)
{
......
......@@ -144,7 +144,11 @@ class SERVER_EXPORT JackTransportEngine : public JackAtomicArrayState<jack_posit
*/
int SetTimebaseMaster(int refnum, bool conditionnal);
void GetTimebaseMaster(int& refnum, bool& conditionnal);
void GetTimebaseMaster(int& refnum, bool& conditionnal)
{
refnum = fTimeBaseMaster;
conditionnal = fConditionnal;
}
/*
\brief
......
......@@ -22,6 +22,7 @@ def create_jack_driver_obj(bld, target, sources, uselib = None):
driver.install_path = '${ADDON_DIR}/'
if uselib:
driver.uselib = uselib
driver.uselib_local = 'serverlib'
return driver
def build(bld):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment