- Highlighting is not added to a frame (and thus not eating cpu) when filtering for debuffs and your class is not capable of dispelling. Hence the check for CanDispel in addHighlight().
- If I add the filter argument to the UnitDebuff call and I can not dispel that debuff it will return a nil name and the highlighter will assume it reached the end of the run and check no more buffs. To fix that I would have to iterate all 40 possible debuffs to find a dispellable debuff -> more cpu used.
I never looked at secure templates before, that's why I wasn't quite sure what I needed to do. I had tried to use :Hide() before I posted here, but the frame was hiding and then showing up again immediately. Then I messed with the events registered for that unit, no luck. So now I took another good look at ouf.lua and I found RegisterUnitWatch, using UnregisterUnitWatch did the trick.