Add caching for QuestieDB.IsPvPQuest and IsActiveEventQuest
Yttrium-tYcLief opened this issue · 0 comments
Necessitated by the new icon features (#4704).
It's important for logic reasons to have an order of preference for quest 'types' displayed, because some quests might be multiple 'types' - for instance, an Event quest could also be Repeatable, and many PvP quests are Repeatable. There are even a few Event quests that are also PvP quests.
With #4704 we instantiate a preference order:
Event > PvP > Repeatable > Normal
In general, if there are active Event quests, a user will want to see them, so anything associated with an event should show with Event flair. After that, all non-Event PvP quests (repeatable or not) should show with PvP flair, since if we gave higher preference for Repeatable, then something like 90% of PvP quests would be lacking their relevant flair.
As of the changes with #4704, we now perform an IsPvPQuest and IsActiveEventQuest check before we test if a quest is Repeatable, for every single quest when we load. This means every normal quest will hit all three of those checks, every Repeatable quest will hit all three, every PvP quest will hit two, and every Event quest will hit one... That's a lot of checks.
Repeatable data (for checks) is already cached for performance reasons, but IsPvPQuest and IsActiveEventQuest are not. As it stands, the performance doesn't seem noticeably bad, but this should still be improved.
Random though: Might be worth to add a caching to `QuestieDB.IsPvPQuest`, `QuestieDB.IsActiveEventQuest`, etc. since it potentially is run quite often 🤷🏻 (not now, but we could create an issue, if you agree that this is a good idea)
Originally posted by @BreakBB in Issue #4704: QuestieQuest.lua