[PATCH] D51539: [clangd] Add symbol slab size to index memory consumption estimates

Eric Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 10 03:37:17 PDT 2018


ioeric accepted this revision.
ioeric added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang-tools-extra/clangd/index/Index.h:512
                  llvm::function_ref<void(const Symbol &)>) const override;
+
   void lookup(const LookupRequest &,
----------------
nit: I'd avoid irrelevant changes.


================
Comment at: clang-tools-extra/clangd/index/MemIndex.cpp:20
+  // Store Slab size before it is moved.
+  const auto BackingDataSize = Slab.bytes();
   auto Data = std::make_pair(std::move(Slab), std::move(Refs));
----------------
Include `Refs` slab size?


================
Comment at: clang-tools-extra/clangd/index/MemIndex.cpp:76
 size_t MemIndex::estimateMemoryUsage() const {
-  return Index.getMemorySize();
+  return Index.getMemorySize() + BackingDataSize;
 }
----------------
Include `Refs` size?


https://reviews.llvm.org/D51539





More information about the cfe-commits mailing list