perf(Core): Optimize damage/heal hot paths and gate Mythic AI#81
Merged
perf(Core): Optimize damage/heal hot paths and gate Mythic AI#81
Conversation
Member
Nyeriah
commented
May 3, 2026
- Cache SpellBuff/MeleeBuff OnlyBosses config bools at load time; avoids per-hit string lookups via sConfigMgr->GetOption.
- Replace mutating NerfInfo[mapId][phase] reads with find()/cached refs to stop std::map::operator[] from inserting empty entries on hot damage/heal paths. Also fixes a silent-insert in the debug branch of ModifySpellDamageTaken when matchingPhase == -1.
- Switch NerfInfo (outer), SpellNerfOverrides, MythicmodeInstanceData, and Expansion from std::map to std::unordered_map. NerfInfo's inner map stays std::map because GetLowestMatchingPhase relies on ordered iteration.
- Add ModZoneDifficulty.MythicmodeAI.Enable (default 0) so OnUnitEnterCombat can early-out without doing IsInstanceMythic / MythicmodeAI lookups when the scripted AI is unused.
- Guard attacker null in the OnlyBosses checks (caster can be null for periodic ticks; matches the existing debug-branch guard).
- Cache SpellBuff/MeleeBuff OnlyBosses config bools at load time; avoids per-hit string lookups via sConfigMgr->GetOption. - Replace mutating NerfInfo[mapId][phase] reads with find()/cached refs to stop std::map::operator[] from inserting empty entries on hot damage/heal paths. Also fixes a silent-insert in the debug branch of ModifySpellDamageTaken when matchingPhase == -1. - Switch NerfInfo (outer), SpellNerfOverrides, MythicmodeInstanceData, and Expansion from std::map to std::unordered_map. NerfInfo's inner map stays std::map because GetLowestMatchingPhase relies on ordered iteration. - Add ModZoneDifficulty.MythicmodeAI.Enable (default 0) so OnUnitEnterCombat can early-out without doing IsInstanceMythic / MythicmodeAI lookups when the scripted AI is unused. - Guard attacker null in the OnlyBosses checks (caster can be null for periodic ticks; matches the existing debug-branch guard). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.