[PATCH] D43511: [dsymutil] Be smarter in caching calls to realpath

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 10:25:10 PST 2018


aprantl added inline comments.


================
Comment at: llvm/tools/dsymutil/DwarfLinker.cpp:125
+private:
+  StringMap<SmallString<256>> ResolvedPaths;
+};
----------------
aprantl wrote:
> I don't know how many entries this StringMap is going to have, but this looks expensive in terms of memory usage. Perhaps consider using a StringMap<std::string> instead?
This is now interning a temporary result that is getting interned again at the call site?

I think it would make more sense to intern the string that is entered into the StringMap and make it a StringMap<StringRef>. Or both? Fred?


https://reviews.llvm.org/D43511





More information about the llvm-commits mailing list