Skip to content

perf: reduce nameplate aura and health work#453

Merged
EllesmereGaming merged 3 commits into
EllesmereGaming:mainfrom
Nnoggie:codex/nameplates-perf-fixes
Jun 24, 2026
Merged

perf: reduce nameplate aura and health work#453
EllesmereGaming merged 3 commits into
EllesmereGaming:mainfrom
Nnoggie:codex/nameplates-perf-fixes

Conversation

@Nnoggie

@Nnoggie Nnoggie commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reduce EllesmereUI Nameplates aura rebuild work by waiting one frame for the paired UNIT_AURA payload before falling back to a full rebuild
  • reuse the already-read curHealth value for health text instead of calling UnitHealth(unit) again

Method

Profiling was done with !!!Perfy instrumentation on EllesmereUINameplates only, using repeated 30-second target dummy tests. For each pass, the live !!!Perfy.lua SavedVariables file was copied before analysis, then analyzed from the copied file. NAP screenshots were used as the coarse addon-level view, and Perfy stack totals were used to identify the concrete hot paths.

The first 30-second capture on five target dummies showed Nameplates at ~174.6ms in NAP and ~177.7ms in Perfy stack time. Most cost came from UpdateAuras (~109.5ms CPU, ~11.39MB allocations) and UpdateHealthValues (~53.6ms CPU).

The aura fix came from tracing the RefreshAuras / UNIT_AURA order. RefreshAuras could run before our UNIT_AURA handler had stashed the update payload, so the code marked an owed full rebuild. The next-frame drain then discarded the gated payload and called UpdateAuras(nil), bypassing relevance checks and causing repeated full aura scans. The fix adds _auraAwaitingUnitAura: wait one frame for UNIT_AURA; if it arrives, process the gated update, otherwise do one full fallback rebuild.

The second 30-second capture showed Nameplates down to ~111.9ms in NAP and ~99.2ms in Perfy. Health then became the next clear path. UpdateHealthValues already reads curHealth, but health text called UnitHealth(unit) again. Reusing curHealth removed that duplicate C API call.

Final observed range after both fixes was ~95-100ms Perfy stack time and ~95-98ms NAP total for Nameplates in the same 30-second target dummy setup. A speculative extra aura guard was tested and dropped because it did not improve the next capture.

@Nnoggie Nnoggie marked this pull request as ready for review June 24, 2026 19:00
@EllesmereGaming EllesmereGaming merged commit f4657be into EllesmereGaming:main Jun 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants