Sohtoren / Altoholic

GNU Affero General Public License v3.0
0 stars 0 forks source link

OnFrameworkUpdate optimization #1

Open hmm-norah opened 1 week ago

hmm-norah commented 1 week ago

From my naive glance at OnFrameworkUpdate it appears as though while playing the game on an unblacklisted character, the plugin is polling a lot of information at a rate that seems unnecessary (every frame? I'm unfamiliar with how OnFrameworkUpdate works.) On a computer with an i7 10700k, this ends up taking an average of 2.25 ms, with 'normal' peaks of 4.7ms, though I have seen up to 7-11ms while not doing any activities that should warrant updating my character's information.

My main concern is how this might affect framerate while in combat, and more generally restricting polled data to inventories that can change in your current state (you can't access retainer/saddlebag content while in a duty for example.) It also seems like it would be a good idea to poll at a more relaxed pace in general. Every 5-10 seconds and when the exit screen appears could cover most cases in my mind.

I'm sure you've considered stuff like this for the future, probably even better implementations than what I've suggested (I have worked a little bit with Dalamud/ClientStructs but honestly not much.) But I thought it could be useful to get this out there, as I really enjoy how the UI for this plugin is laid out as compared to say, Allagan Tools.

Thank you for your time and consideration of this issue!

Sohtoren commented 1 week ago

Hey, thanks for the feedback. Indeed, optimization are planned but as I will still implement a lot of things while in testing, those will come toward the end. I guess I could in the meantime implement the one that are duty limited, I'll see about it.