pre-ship: resolve the new audio diagnostic gates ONCE instead of per frame
RunSequence and AudioIdleWatcher::Execute run per sequence per frame, so the BT_ATTRBIND_LOG probes added while chasing #99 were calling getenv ~2700x/sec on a 15-sequence mech. Small, but this is the same path the source-pooling fix (#32) just bought 10% of frame time in, and an unset diagnostic should cost nothing. Cached in function-static flags. Pre-ship smoke (combat, 2 kills, a respawn, clean teardown): frame time 7.18 / 8.27 / 8.71 ms -- matches the post-pooling 7.79ms baseline 0 asserts, 0 access violations, 0 audio acquireFails Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
7c08e8bd03
commit
5a1a407ed1
@@ -475,7 +475,8 @@ void
|
||||
//
|
||||
// #99 probe: PER-SEQUENCE throttle. A single shared counter here hid the
|
||||
// alarm sequence entirely -- the busy sequences ate every slot.
|
||||
if (getenv("BT_ATTRBIND_LOG") && isLooped) { if (runProbeCount < 6)
|
||||
static const int s_seqDiag = (getenv("BT_ATTRBIND_LOG") != 0); // hot path: resolve once
|
||||
if (s_seqDiag && isLooped) { if (runProbeCount < 6)
|
||||
{ ++runProbeCount;
|
||||
DEBUG_STREAM << "[seqrun] seq=" << (void *)this
|
||||
<< " isRunning=" << (int)isRunning
|
||||
@@ -494,7 +495,7 @@ void
|
||||
|
||||
Check(audioControlEventIterator);
|
||||
control_event = audioControlEventIterator->GetCurrent();
|
||||
if (getenv("BT_ATTRBIND_LOG")) { static int s_nr=0;
|
||||
if (s_seqDiag) { static int s_nr=0;
|
||||
if (control_event != NULL && !IsEventReady(control_event) && (s_nr++ % 500)==0)
|
||||
{
|
||||
AudioTime off(startTime);
|
||||
@@ -539,7 +540,7 @@ void
|
||||
// Send the controller to the connected audio component
|
||||
//
|
||||
Check(control_event);
|
||||
if (getenv("BT_ATTRBIND_LOG")) { static int s_se=0; if (s_se++<60)
|
||||
if (s_seqDiag) { static int s_se=0; if (s_se++<60)
|
||||
DEBUG_STREAM << "[seqsend] seq=" << (void *)this
|
||||
<< " -> comp=" << (void *)audioComponentSocket.GetCurrent()
|
||||
<< " ctl=" << (int)control_event->audioControlID
|
||||
|
||||
@@ -112,7 +112,8 @@ void
|
||||
{
|
||||
Check(this);
|
||||
Check(audioComponentSocket.GetCurrent());
|
||||
if (getenv("BT_ATTRBIND_LOG")) { static int s_iw=0; if ((s_iw++ % 400)==0)
|
||||
static const int s_idleDiag = (getenv("BT_ATTRBIND_LOG") != 0); // hot path: resolve once
|
||||
if (s_idleDiag) { static int s_iw=0; if ((s_iw++ % 400)==0)
|
||||
DEBUG_STREAM << "[idlewatch] #" << s_iw << " comp="
|
||||
<< (void *)audioComponentSocket.GetCurrent() << std::endl; }
|
||||
audioComponentSocket.GetCurrent()->ReceiveControl(
|
||||
|
||||
Reference in New Issue
Block a user