From 7ce0d6cc338e305a99fedb3d86a7f3fa51d51b33 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 14 Mar 2019 09:57:10 +0000 Subject: [PATCH] [clangd] Build Dex index after loading all shards in BackgroundIndex. Summary: Currently after loadding all shards, we use MemIndex which has poor query performance, we should use Dex. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59350 llvm-svn: 356126 --- clang-tools-extra/clangd/index/Background.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/clang-tools-extra/clangd/index/Background.cpp b/clang-tools-extra/clangd/index/Background.cpp index 79f2125..8aa5982 100644 --- a/clang-tools-extra/clangd/index/Background.cpp +++ b/clang-tools-extra/clangd/index/Background.cpp @@ -374,7 +374,9 @@ void BackgroundIndex::buildIndex() { // 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 @@ BackgroundIndex::loadShards(std::vector ChangedFiles) { } } 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; } -- 2.7.4