Did you do any CPU profiling comparing the two methods?
|
I'm interested :)
I tested build 15913 and it seems they've fixed the :GetChildren() crash, can't reproduce it in any of the situations I used for previous build (it wasn't 100% reproducible, seemed to happen reliably when many nameplates spawned - ex. training all the mobs in Stockade). Anyway, it seems the client no longer crashes with WorldFrame:GetChildren() so I reverted back to the 'traditional' way of finding plates as simpler. Will keep an eye on this thread though for sure, an alternative is good to have. |
@ballagarba
The two versions don't differ that much. Both use OnUpdate. (Even the animationgroup does). The only big difference is that in the traditional way you iterate over all WorldFrame:GetChildren() all the time. In the new version you check just one index that is either available or not. |
Quote:
|
Why are you using an animationgroup for this?
|
Because for the past few years now it's been the cool kids' way of writing a timer. The theory is since it's done in C, it's less overhead. Since we can't measure, I don't actually buy it.
|
Quote:
one of the most requested features in my experience is the ability to control the in-game "range" at which nameplates become visible (currently "hardcoded" at 40 yards, in game terms; used to be much shorter, several major revisions ago). i requested this in the Blizzard forums, long ago and far away, but never heard a peep in response. some folks want to shorten this range, so they update fewer frames. its funny, too... i never experienced this crash with :GetChildren(). i was not among the first round(s) of Beta access granted, however. seems to have been fixed by the time i received my Blizzard email. |
Quote:
|
Alright, haven't really used animationgroups before so I just found it weird to be used like this.
One thing tho, to avoid spamming the loading process, run :Play() on PLAYER_LOGIN. Lua Code:
|
Tried both methods today, though as hard as it is to try and stress-test this, I ended up with some results.
The "new" method uses 0.01 CPU/ms less than the previous method (on average), and 0.1 CPU/ms less during stress testing (20+ nameplates). This was tested with the addon Addon Profiler, and both versions were polling 5 times per second. These values are so miniscule, you can just use what ever you prefer tbh. Personally, I will use the stuff I came up with, just because :p. |
really helpful thread. thank you for sharing this. :)
since all we like efficiency, do CVars-checking will help as well? or useless thoughts? Lua Code:
|
All times are GMT -6. The time now is 08:41 PM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI