Reduce timer-tick CPU load by removing per-tick ResizeSMeter and throttling AGC line updates

- Remove ResizeSMeter (Pango font measurement + multiple SetBounds) from 60 Hz timer tick;
  it is still called on actual resize events
- Throttle UpdateAGCLines WDSP API calls from 60 Hz to ~10 Hz (every 6 ticks)
- Optimize spectrum alpha-fix loop: write-only byte access instead of read-modify-write DWORD

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-24 18:51:41 +03:00
co-authored by Claude Sonnet 4.6
parent 03693dc0f4
commit 1eecd974fc
2 changed files with 15 additions and 7 deletions
+9 -4
View File
@@ -301,6 +301,7 @@ type
// Waterfall frame timing
FWaterfallFrameInterval: Integer;
FWaterfallFrameCounter: Integer;
FAgcLineCounter: Integer;
// ---- Splitter ----
FSplitterDrag: Boolean;
FSplitterDragY0: Integer;
@@ -2874,7 +2875,6 @@ begin
((PbWaterfall.Width <> FSpectrumWidth) or
(PbWaterfall.Height <> FWaterfallHeight))) then
ResizeSpectrumPanels;
ResizeSMeter;
if FSpectrumWidth <= 0 then Exit;
SyncSpecViewFreq;
@@ -2920,9 +2920,14 @@ begin
begin
FLastSMeter := FDSPEngine.GetSMeterDBm;
FDSPEngine.SetSpectrumWidth(FSpectrumWidth);
FDSPEngine.UpdateAGCLines(FSpectrumWidth);
FSpecView.AGCThresh := FDSPEngine.AGCThresh;
FSpecView.AGCHangLevel := FDSPEngine.AGCHangLevel;
Inc(FAgcLineCounter);
if FAgcLineCounter >= 6 then
begin
FDSPEngine.UpdateAGCLines(FSpectrumWidth);
FSpecView.AGCThresh := FDSPEngine.AGCThresh;
FSpecView.AGCHangLevel := FDSPEngine.AGCHangLevel;
FAgcLineCounter := 0;
end;
end;
FSpecView.WDSPReady := FWDSPReady;
// Обновляем оверлей если видим