From 41293a058de93114cc42982359bdc99bef68ed59 Mon Sep 17 00:00:00 2001 From: Glen Miner Date: Tue, 17 Dec 2024 12:44:14 -0500 Subject: 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 --- include/channels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/channels.h b/include/channels.h index 8d8355257..cb102be34 100644 --- a/include/channels.h +++ b/include/channels.h @@ -43,7 +43,7 @@ class CoreExport Channel final public: /** A map of Memberships on a channel keyed by User pointers */ - typedef std::map> MemberMap; + typedef std::unordered_map> MemberMap; private: /** Set default modes for the channel on creation -- cgit v1.3.1-10-gc9f91