[clang-tools-extra] r344679 - [clangd] Print numbers of symbols and refs as well when loading the

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 17 01:48:05 PDT 2018


Author: hokein
Date: Wed Oct 17 01:48:04 2018
New Revision: 344679

URL: http://llvm.org/viewvc/llvm-project?rev=344679&view=rev
Log:
[clangd] Print numbers of symbols and refs as well when loading the
index.

Modified:
    clang-tools-extra/trunk/clangd/index/Serialization.cpp

Modified: clang-tools-extra/trunk/clangd/index/Serialization.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/index/Serialization.cpp?rev=344679&r1=344678&r2=344679&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/index/Serialization.cpp (original)
+++ clang-tools-extra/trunk/clangd/index/Serialization.cpp Wed Oct 17 01:48:04 2018
@@ -496,13 +496,18 @@ std::unique_ptr<SymbolIndex> loadIndex(l
     }
   }
 
+  size_t SymSize = Symbols.size();
+  size_t RefSize = Refs.size();
   trace::Span Tracer("BuildIndex");
   auto Index =
       UseDex ? dex::Dex::build(std::move(Symbols), std::move(Refs), URISchemes)
              : MemIndex::build(std::move(Symbols), std::move(Refs));
-  vlog("Loaded {0} from {1} with estimated memory usage {2}",
+  vlog("Loaded {0} from {1} with estimated memory usage {2} bytes\n"
+       "  - number of symbos: {3}\n"
+       "  - number of refs: {4}\n",
        UseDex ? "Dex" : "MemIndex", SymbolFilename,
-       Index->estimateMemoryUsage());
+       Index->estimateMemoryUsage(),
+       SymSize, RefSize);
   return Index;
 }
 




More information about the cfe-commits mailing list