[PATCH] D86406: Speedup llvm-dwarfdump 3.9x

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 12:03:01 PDT 2020


JDevlieghere added a comment.

If I understand the patch correctly, the speedup is gained by caching the mode instead of trying to recompute it every time we call `colorsEnabled()`? This seems like a huge speedup for such a small thing, maybe I'm missing something?

In D86406#2232912 <https://reviews.llvm.org/D86406#2232912>, @jhenderson wrote:

> Also, perhaps this should be done by the stream itself - it seems like the stream knows whether or not it supports colours, so should we not just have the stream ignore attempts to use colours if the underlying thing doesn't support them?

We already disable colors when they're not supported by the stream.

In D86406#2232918 <https://reviews.llvm.org/D86406#2232918>, @jankratochvil wrote:

> OK, I agree, I will move it there.  That should also solve the caching problem.

I don't think we should move it into the stream, if that's what you mean by "there". The color `cl::opt` is part of WithColor so we should check its value there.

Can we achieve the same thing by resolving the ColorMode to `Enable` and `Disable` in the WihtColor constructor?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86406



More information about the llvm-commits mailing list