errors and warnings / debugging / P7201
P7201 hint
A function creates a large share of the addon's garbage; reuse tables or cache results
- area
- debugging (x7xxx)
- fails the build
- no
A performance hint from the dev window, not the compiler. A single function created a large share of the garbage the addon's functions made in the recording. Garbage is every table, closure and new string that is created and dropped again; the game collects it in steps, and the collection costs frame time, for every addon.
Reuse tables instead of creating them per call (clear them with wipe),
move closures that capture nothing out of loops and handlers, cache results
that don't change, and build strings once instead of in every frame. The hint
needs garbage per function, which the dev window's switch or the profile's
profile-garbage turns on.
Related codes
| code | message |
|---|---|
| P7301 | A single call took longer than the frame budget; spread the work across frames with wowlua:jobs |
Offline
$ wowlua explain P7201 P7201 (hint): A function creates a large share of the addon's garbage; reuse tables or cache results