Skip to content

feat: faster loading for collection cache#223

Merged
Helias merged 1 commit intoazerothcore:masterfrom
r-o-b-o-t-o:feat/faster-collection-cache-loading
Jan 29, 2026
Merged

feat: faster loading for collection cache#223
Helias merged 1 commit intoazerothcore:masterfrom
r-o-b-o-t-o:feat/faster-collection-cache-loading

Conversation

@r-o-b-o-t-o
Copy link
Member

Sped up the initial collection cache loading: it used to take ~75 seconds for about 20 million rows on my system, now takes ~15 seconds.
The slowdown was caused by the reordering of the vector at each insert (no idea why it was even being sorted in the first place, it's only item GUIDs, which have no relevance to the EnableSortByQualityAndName setting...)
The change from vector to unordered_set isn't really that impactful performance-wise but it helps make the code a bit cleaner in my opinion.

@Nyeriah Nyeriah requested a review from Helias January 28, 2026 23:23
@Helias Helias merged commit 6b4e0d6 into azerothcore:master Jan 29, 2026
1 check passed
@Helias
Copy link
Member

Helias commented Jan 29, 2026

Thanks!
you could also improve

this

        uint32 accountId = player->GetSession()->GetAccountId();
        if (sT->collectionCache.find(accountId) == sT->collectionCache.end())
            return allowedItems;

instead of using .find() we can use .contains now, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants