[PATCH] D58296: [llvm-objcopy] Make removeSectionReferences batched

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 20 02:08:58 PST 2019


jhenderson added inline comments.


================
Comment at: llvm/tools/llvm-objcopy/ELF/Object.cpp:1358
   // an error here instead.
+  std::vector<const SectionBase *> RemoveSections;
+  RemoveSections.reserve(std::distance(Iter, std::end(Sections)));
----------------
I'm staring at this and thinking that an unordered Set may be a better container for performance here, especially given our use of pointers, making the comparison and hashing operations cheap. It would remove the need for sort and binary_search in favour of a set lookup, which is (usually) constant time.

Have I missed something?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D58296





More information about the llvm-commits mailing list