v0.13.7
errors and warnings / debugging

errors and warnings / debugging / P7101

P7101 hint

A handler runs very often in a recording (bursts of the same event); collapse bursts with @throttle from wowlua:timer

area
debugging (x7xxx)
fails the build
no

A performance hint from the dev window, not the compiler. A handler ran very often in the recording, in bursts: the same event arrived many times within a short time and the handler did its full work for each one. Events such as UNIT_AURA, BAG_UPDATE or COMBAT_LOG_EVENT_UNFILTERED can fire dozens of times in one frame, while the addon usually only needs the last state.

Collapse a burst into one call: decorate the function that does the work with @throttle(0.1) or @debounce(0.1) from wowlua:timer, or mark it @nextFrame so that many calls in one frame run it once. Keep the handler itself cheap, and filter on the event's arguments (the unit, the bag) before doing anything else.

codemessage
P7301A single call took longer than the frame budget; spread the work across frames with wowlua:jobs

Offline

terminal
$ wowlua explain P7101
P7101 (hint): A handler runs very often in a recording (bursts of the same event); collapse bursts with @throttle from wowlua:timer

source on GitHub ↗