Optimized membership lookup for large servers

On our server hosting 150K users we noticed that std::map lookups for user membership were high on the profile. Since there seemed to be no ordered iteration needed we were able to shave a few % off of the profile by changing this to a std::unordered_map
This commit is contained in:
Glen Miner 2024-12-17 12:44:14 -05:00 committed by Sadie Powell
parent 5084eca9ba
commit 41293a058d

View File

@ -43,7 +43,7 @@ class CoreExport Channel final
public:
/** A map of Memberships on a channel keyed by User pointers
*/
typedef std::map<User*, insp::aligned_storage<Membership>> MemberMap;
typedef std::unordered_map<User*, insp::aligned_storage<Membership>> MemberMap;
private:
/** Set default modes for the channel on creation