[llvm] [ProfData] Improve efficiency of reader (PR #169730)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 26 13:09:49 PST 2025


================
@@ -399,15 +399,30 @@ LLVM_DUMP_METHOD void FunctionSamples::dump() const { print(dbgs(), 0); }
 std::error_code ProfileSymbolList::read(const uint8_t *Data,
                                         uint64_t ListSize) {
   const char *ListStart = reinterpret_cast<const char *>(Data);
-  uint64_t Size = 0;
+  uint64_t Offset = 0;
   uint64_t StrNum = 0;
-  while (Size < ListSize && StrNum < ProfileSymbolListCutOff) {
-    StringRef Str(ListStart + Size);
+  uint64_t ExpectedCount = 0;
+
+  Scan forward to see how many elements we expect.
----------------
vitalybuka wrote:

// is missing?

https://github.com/llvm/llvm-project/pull/169730


More information about the llvm-commits mailing list