diff options
| author | Rye <rye@alchemyviewer.org> | 2026-01-10 04:54:34 -0500 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2026-01-21 22:07:08 +0200 |
| commit | 8b3558e59f9c67abe4c958f01206bb630ee2311f (patch) | |
| tree | 12a6082d55b3fdbff69787c65a4b09797cab37f0 /indra/llmessage/llcachename.cpp | |
| parent | 1b12a1dc76ee33a7e0394773492f92c1fdaa9c31 (diff) | |
Optimize map usage in name cache with unordered_map for maps with frequent find access
Diffstat (limited to 'indra/llmessage/llcachename.cpp')
| -rw-r--r-- | indra/llmessage/llcachename.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp index 56dfaef873..95b7bb8c3d 100644 --- a/indra/llmessage/llcachename.cpp +++ b/indra/llmessage/llcachename.cpp @@ -179,12 +179,11 @@ void ReplySender::flush() } } - -typedef std::set<LLUUID> AskQueue; -typedef std::list<PendingReply*> ReplyQueue; -typedef std::map<LLUUID,U32> PendingQueue; -typedef std::map<LLUUID, LLCacheNameEntry*> Cache; -typedef std::map<std::string, LLUUID> ReverseCache; +using AskQueue = std::set<LLUUID>; +using ReplyQueue = std::list<PendingReply*>; +using PendingQueue = std::unordered_map<LLUUID, U32>; +using Cache = std::unordered_map<LLUUID, LLCacheNameEntry*>; +using ReverseCache = std::unordered_map<std::string, LLUUID>; class LLCacheName::Impl { @@ -214,7 +213,7 @@ public: Impl(LLMessageSystem* msg); ~Impl(); - bool getName(const LLUUID& id, std::string& first, std::string& last, std::map<std::string, std::string>& default_names); + bool getName(const LLUUID& id, std::string& first, std::string& last, cache_map_t& default_names); boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); void addPending(const LLUUID& id, const LLHost& host); @@ -401,7 +400,7 @@ void LLCacheName::exportFile(std::ostream& ostr) } -bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last, std::map<std::string, std::string>& default_names) +bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last, cache_map_t &default_names) { if(id.isNull()) { |
