[PATCH] D27768: COFF: Open and map input files asynchronously on Windows.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 14 18:00:27 PST 2016

pcc added a comment.

In https://reviews.llvm.org/D27768#622969, @pcc wrote:

> That's a good point, I'll do that. Although we could fail to map the file, it's probably fine to exit on the thread since that's less likely than open failing.

Done. Although the code certainly looks cleaner, now that I've thought about it more I'm not sure whether it's a good idea. Since we now leave file descriptors open for a longer period of time, we may become liable to exceeding limits on the number of open file descriptors, whereas with the previous patch a reasonable implementation of std::future would limit the number of concurrent tasks and hence the number of open file descriptors. I guess one way to avoid that could be to dequeue tasks once we reach a predefined size limit. That would make the behavior a little harder to reason about though.

That said, the new latency numbers are: fat archives 9.85s, thin archives 11.08s. Which seems reasonable to me.


More information about the llvm-commits mailing list