[Lldb-commits] [PATCH] D122980: make ConstStringTable use DenseMap rather than std::map

Luboš Luňák via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sat Apr 2 09:50:28 PDT 2022


llunak updated this revision to Diff 419996.
llunak retitled this revision from "make ConstStringTable use std::unordered_map rather  than std::map" to "make ConstStringTable use DenseMap rather  than std::map".
llunak edited the summary of this revision.
llunak added a comment.

In D122980#3424636 <https://reviews.llvm.org/D122980#3424636>, @JDevlieghere wrote:

> Could we use a `llvm::DenseMap` here, as it's supposedly even faster than its STL counterpart?

Yes, it is, I've updated the patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122980/new/

https://reviews.llvm.org/D122980

Files:
  lldb/include/lldb/Core/DataFileCache.h


Index: lldb/include/lldb/Core/DataFileCache.h
===================================================================
--- lldb/include/lldb/Core/DataFileCache.h
+++ lldb/include/lldb/Core/DataFileCache.h
@@ -13,6 +13,7 @@
 #include "lldb/Utility/Status.h"
 #include "lldb/Utility/UUID.h"
 #include "lldb/lldb-forward.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/Support/Caching.h"
 #include <mutex>
 
@@ -190,7 +191,7 @@
 
 private:
   std::vector<ConstString> m_strings;
-  std::map<ConstString, uint32_t> m_string_to_offset;
+  llvm::DenseMap<ConstString, uint32_t> m_string_to_offset;
   /// Skip one byte to start the string table off with an empty string.
   uint32_t m_next_offset = 1;
 };


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D122980.419996.patch
Type: text/x-patch
Size: 698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220402/98d0b0ee/attachment.bin>


More information about the lldb-commits mailing list