[PATCH] D128093: [lld-macho] Initial support for Linker Optimization Hints

Noel Grandin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 19 05:02:09 PDT 2022


grandinj added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:509
+
+    optimizationHints.push_back(
+        {type, {address[0], address[1], address[2]}, minAddress});
----------------
I'm guessing if you run a profiler over this (like perf), you will see significant time spent in resizing/re-allocating the vector.
You could avoid this by calling reserve before the loop to reserve storage.

Alternatively, just use std::deque instead. It handles this case well, and doesn't need to re-allocate/resize.


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

https://reviews.llvm.org/D128093



More information about the llvm-commits mailing list