[PATCH] D135929: [profile] Add binary ids into indexed profiles

Gulfem Savrun Yeniceri via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 31 16:10:01 PDT 2022


gulfem added inline comments.


================
Comment at: llvm/tools/llvm-profdata/llvm-profdata.cpp:344
+
+  std::vector<llvm::object::BuildIDRef> BinaryIds;
+  if (Error E = Reader->readBinaryIds(BinaryIds))
----------------
ellis wrote:
> `SmallVector<T, 0>` seems to be preferred over `std::vector<T>` even if the number of elements is large.
> 
> https://www.llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h
The way I interpret Programmers Manual on `SmallVector` is that it good for the containers that have small number of elements:
"This is good for vectors that are “usually small” (e.g. the number of predecessors/successors of a block is usually less than 8)."
This container might include thousands of elements when all the profiles are merged together while collecting coverage in a big project.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135929/new/

https://reviews.llvm.org/D135929



More information about the llvm-commits mailing list