Skip to content

Commit 7f21061

Browse files
committed
Phase 4 Task 2: DirtyFlagManager Integration for Batched Frame Updates (v1.24.0)
MAJOR: Intelligent frame update batching via PerformanceLib.DirtyFlagManager Performance Improvements: • Event coalescing: 69.6% efficiency (1,963 of 2,816 events batched) • Frame time: 16.66ms avg, P99=28ms (stable at 60 FPS) • UNIT_HEALTH: 78% reduction (695→124 dispatched) • UNIT_POWER_UPDATE: 72% reduction (335→94 dispatched) • UNIT_AURA: 54% reduction (457→211 dispatched) • Dropped frames: 0 (perfect stability) • DirtyFlagManager: 229 frames processed in 105 batches New Features: • DirtyFlagManager helper functions: GetFrameUpdatePriority, MarkFrameDirty, MarkAllFramesDirty, MarkFramesByUnitTypeDirty • Interactive TestPanel: /suf test command with 6 test buttons (Phase 1-3c + Stats) • Event coalescing config expansion: 14 new events (13 UNIT_SPELLCAST_* + UNIT_AURA) • Priority-based frame batching: player (CRITICAL) → target (HIGH) → party (MEDIUM) → raid (LOW) • Graceful fallback to synchronous updates when PerformanceLib unavailable Changes: • SimpleUnitFrames.lua: - Lines 4113-4213: New DirtyFlagManager helper functions - Lines 6910-6943: UpdateAllFrames with batching + fallback - Lines 7683-7725: UpdateFramesByUnitType with batching + fallback - Lines 2725-2744: DirtyFlagManager initialization in SetupPerformanceLib - Lines 730-785: EVENT_COALESCE_CONFIG expanded (14 new events) - Lines 705-728: PERF_EVENT_PRIORITY with casting event priorities - Lines 3209-3343: HandleCoalescedUnitEvent with priority routing • Modules/UI/TestPanel.lua: New interactive test panel (450+ lines) • Modules/System/Commands.lua: /suf test command integration • SimpleUnitFrames.toc: Version 1.24.0, added TestPanel.lua • TODO.md: Phase 4 Task 2 marked COMPLETE with full validation results • WORK_SUMMARY.md: Testing results and performance metrics documented Event Configuration: • Added UNIT_SPELLCAST_START, STOP, CHANNEL_*, EMPOWER_* • Added UNIT_SPELLCAST_FAILED, INTERRUPTED, DELAYED, UPDATE • Added UNIT_SPELLCAST_INTERRUPTIBLE, NOT_INTERRUPTIBLE • Added UNIT_AURA (missing from original config) • Priority tuning: START events HIGH (priority 2), STOP/UPDATE/FAILED LOW (priority 4) • Delays: 0.05-0.12s based on event frequency and impact Testing & Validation: ✅ COMPLETE • Phase 1: Addon load test PASSED • Phase 2: Solo play test PASSED • Phase 3: Profiler baseline PASSED • Phase 4: Event routing PASSED • Phase 5: Priority tuning PASSED • All success criteria met (0 dropped frames, P99=28ms) Backward Compatibility: • All DirtyFlagManager calls wrapped in performanceLib check • Fallback to synchronous updates if PerformanceLib not loaded • No breaking changes to existing APIs Documentation: • docs/PHASE4_SESSION_SUMMARY.md: Session timeline and debugging logs • docs/PHASE4_TASK2_IMPLEMENTATION_PLAN.md: Design and implementation strategy • docs/PHASE4_TASK2_IMPLEMENTATION_COMPLETE.md: What was built and how to use Version: 1.24.0 (Phase 4 Task 2 release) Fixes: • Fixed invalid event name PLAYER_LEADER_CHANGED → verified PARTY_LEADER_CHANGED • Fixed TestPanel slash command registration (RegisterChatCommand instead of RegisterSlashCommands) • Fixed missing UNIT_AURA in EVENT_COALESCE_CONFIG • Fixed event routing priority parameter passing (eventName → priority)
1 parent d286640 commit 7f21061

10 files changed

Lines changed: 2165 additions & 20 deletions

Libraries/oUF/elements/castbar.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,11 @@ local eventMethods = {
585585

586586
local function Enable(self, unit)
587587
local element = self.Castbar
588+
local addon = _G.SimpleUnitFrames
589+
if addon and addon.DebugLog then
590+
addon:DebugLog("castbar.Enable", "Called: unit=" .. tostring(unit) .. " hasElement=" .. tostring(element ~= nil) .. " matches=%wtarget$=" .. tostring(unit and unit:match('%wtarget$') or false), 2)
591+
end
592+
588593
if(element and unit and not unit:match('%wtarget$')) then
589594
element.__owner = self
590595
element.ForceUpdate = ForceUpdate

Modules/System/Commands.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ function addon:ShowLauncherHelp()
4040
self:Print(addonName .. ": /sufperf (performance dashboard)")
4141
self:Print(addonName .. ": /sufprofile <start|stop|sample|analyze> (alias -> /perflib profile ...)")
4242
self:Print(addonName .. ": /libperf (alias -> /sufperf)")
43+
self:Print(addonName .. ": /suf test (interactive test panel)")
4344
self:Print(addonName .. ": /suf debug")
4445
self:Print(addonName .. ": /suf status")
4546
self:Print(addonName .. ": /suf protected (see also: /SUFprotected help)")
@@ -226,6 +227,10 @@ function addon:HandleSUFSlash(msg)
226227
self:ToggleDebugPanel()
227228
return
228229
end
230+
if command == "test" then
231+
self:ShowTestPanel()
232+
return
233+
end
229234
if command == "reload" or command == "rl" then
230235
self:PromptReloadUI("Reload SUF/UI now?")
231236
return

0 commit comments

Comments
 (0)