5.9 KiB
3.8.3 profiling: current bottlenecks and theme cost
Only the player can run these checks in the game. No performance gain has been measured by the automated tests. The live game folder was not modified.
Focused theme comparison
First measure the current configuration, then repeat with both recoloring options off, Golden UI only, and Darkened UI only. Reload after each setting change. Use the same addons, character, location, FPS limit and GentleGC configuration.
For every mode, warm up for two minutes and open the same windows once before sampling. Then take three 60-second idle samples and three 60-second samples opening/closing the same map, bags, mail and auction windows the same number of times. Record CPU ms/s, memory before/after, and any hitches. Measure initial window creation separately from repeated openings if only the first opening hitches.
| Mode | Scenario | CPU ms/s, three runs | Memory before/after | Hitches |
|---|---|---|---|---|
| Both themes off | Idle / windows | |||
| Golden UI only | Idle / windows | |||
| Darkened UI only | Idle / windows |
The reported 6.2 MB versus 6.9 MB is approximately 0.7 MB extra retained Lua memory. These two snapshots do not measure allocation rate, CPU cost or a leak. After several identical window-opening cycles and natural GC cycles, check whether memory settles or keeps rising. Do not manually collect during CPU runs.
Also profile the current build in combat/forms/healing as below. Theme comparisons isolate one option's cost; they do not establish gains over an older release.
First verify behavior
- Real Health Numbers: take damage, heal, spend/regenerate power, switch targets and summon/dismiss a pet. Druid forms should show the appropriate resource and update the separate mana display. Check Big Health and Personal Resource Display layouts.
- Swing/Wand Timer: attack, stop, move out of range, change targets, and change weapons. Dual-wield bars and wand Shoot should reset and stop correctly.
- Druid Maul or Warrior Heroic Strike/Cleave: queue and cancel, checking colors. Hunter Auto Shot: check the last-half-second red warning if a Hunter is available.
- Hold Ctrl+Shift+Alt during a swing: preview labels remain stable, countdowns resume on release, and drag/reset/saved positions still work after reload.
- Energy & Mana Tick: test a fresh login, Cat/Bear/caster transitions, spending mana, channel completion/cancellation, a potion and a drain if practical. Verify the spark after the first observed gain, its five-second cast-cost sweep, and resizing with Big Health and Personal Resource Display bars.
- Macros: test bare/explicit/conditional #showtooltip, item macros, castsequence, chosen icons and any legacy --showtooltip or /pfcast display hints you use. Edit/delete a custom hint and reload; check for stale overrides. Check missing /equip, /use, focus and attack aliases without replacing another addon's aliases.
- Shift-compare rings, trinkets and weapons from bags/vendors/chat links; check one empty paired slot, enchanted/random-suffix items, Shift release, hover changes and tooltip closure. Compare with other tooltip addons enabled.
Find the remaining bottlenecks
Profile the current build first. The purpose is to identify expensive workloads and then narrow them down to modules/functions, not to prove the recent changes made the addon faster. Older builds are not required for this investigation.
Keep the same character, location, target, addon list, UI settings and frame-rate limit. Enable Real Health Numbers and the applicable Swing/Wand Timer in both. Warm up for two minutes after loading; do not include loading or option changes in a measured run. Keep GentleGC and other client mods configured identically.
Enable profiling, then reload:
/console scriptProfile 1
/reload
Start each sample with:
/script ResetCPUUsage(); STPerfStart=GetTime()
Perform the chosen scenario for about 60 seconds, then print average addon Lua CPU milliseconds per elapsed second:
/script UpdateAddOnCPUUsage(); DEFAULT_CHAT_FRAME:AddMessage(string.format("ShaguTweaks: %.3f ms/s over %.1f s",GetAddOnCPUUsage("ShaguTweaks")/(GetTime()-STPerfStart),GetTime()-STPerfStart))
Scenarios: (1) idle with no windows open; (2) steady melee/wand attacks; (3) repeated damage/healing and power changes, including druid form changes; (4) repeated map, inventory, mail and auction-window interactions. Record which windows were used and how many times. Repeat each three times on the current build and compare medians. Repeating comparable activity matters more than identical duration alone.
These addon totals are the first triage step, not module/function attribution. For workloads with meaningful cost, follow with focused function CPU profiling and, where practical, repeat the same scenario with one relevant option disabled (reload after changing options). That separates module cost from unrelated activity and tells us where a code change might be worthwhile. Respect the decision to preserve the working theme recoloring behavior.
At the same point after warm-up and after a fixed test session, sample Lua memory:
/script UpdateAddOnMemoryUsage(); DEFAULT_CHAT_FRAME:AddMessage(string.format("ShaguTweaks: %.1f KiB",GetAddOnMemoryUsage("ShaguTweaks")))
Memory includes uncollected objects; compare at equivalent GentleGC collection points. Do not force collections during CPU samples. Native textures/DLL memory and total garbage production are not represented by this single memory number.
Send the build, scenario, enabled options, three CPU results and memory readings. Those results guide the next targeted investigation. Lower addon Lua CPU does not by itself prove higher FPS: native timer work moves out of Lua, profiling adds overhead, and other addons/client rendering may dominate. Do not use GetFrameCPUUsage for this comparison. Afterward, turn profiling off:
/console scriptProfile 0
/reload