hokein created this revision.
hokein added a reviewer: kadircet.
Herald added subscribers: arphaman, jkorous, MaskRay, ioeric, ilya-biryukov.
Herald added a project: clang.

Currently after loadding all shards, we use MemIndex which has poor query
performance, we should use Dex.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D59350

Files:
  clangd/index/Background.cpp


Index: clangd/index/Background.cpp
===================================================================
--- clangd/index/Background.cpp
+++ clangd/index/Background.cpp
@@ -374,7 +374,9 @@
     // extra index build.
     reset(
         IndexedSymbols.buildIndex(IndexType::Heavy, DuplicateHandling::Merge));
-    log("BackgroundIndex: rebuilt symbol index.");
+    log("BackgroundIndex: rebuilt symbol index with estimated memory {0} "
+        "bytes.",
+        estimateMemoryUsage());
   }
 }
 
@@ -603,8 +605,10 @@
     }
   }
   vlog("Loaded all shards");
-  reset(IndexedSymbols.buildIndex(IndexType::Light, DuplicateHandling::Merge));
-
+  reset(IndexedSymbols.buildIndex(IndexType::Heavy, DuplicateHandling::Merge));
+  vlog("BackgroundIndex: built symbol index with estimated memory {0} "
+        "bytes.",
+        estimateMemoryUsage());
   return NeedsReIndexing;
 }
 


Index: clangd/index/Background.cpp
===================================================================
--- clangd/index/Background.cpp
+++ clangd/index/Background.cpp
@@ -374,7 +374,9 @@
     // extra index build.
     reset(
         IndexedSymbols.buildIndex(IndexType::Heavy, DuplicateHandling::Merge));
-    log("BackgroundIndex: rebuilt symbol index.");
+    log("BackgroundIndex: rebuilt symbol index with estimated memory {0} "
+        "bytes.",
+        estimateMemoryUsage());
   }
 }
 
@@ -603,8 +605,10 @@
     }
   }
   vlog("Loaded all shards");
-  reset(IndexedSymbols.buildIndex(IndexType::Light, DuplicateHandling::Merge));
-
+  reset(IndexedSymbols.buildIndex(IndexType::Heavy, DuplicateHandling::Merge));
+  vlog("BackgroundIndex: built symbol index with estimated memory {0} "
+        "bytes.",
+        estimateMemoryUsage());
   return NeedsReIndexing;
 }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to