[PATCH] D93001: [lld-macho] Don't load dylibs more than once

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 15:54:29 PST 2020


int3 added inline comments.


================
Comment at: lld/MachO/DriverUtils.cpp:181
 
+static StringSet<> loadedDylibs;
+
----------------
smeenai wrote:
> StringSet copies all the strings you add to it. I don't think that's a huge deal for this use case, but just something to keep in mind if this ever starts showing up in profiles.
> 
> (A SmallSet of StringRef would avoid the copying, but you'd rehash all the strings whenever you grew the set. A SmallSet of CachedHashStringRef would avoid both the copying and the rehashing, but it feels kinda overkill?)
I don't know if the set will be small... libSystem alone re-exports 67 dylibs. But a DenseSet of CachedHashStringRef seems easy enough :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93001



More information about the llvm-commits mailing list