[PATCH] D52611: [clangd] Add more tracing to index queries. NFC

Kirill Bobyrev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 27 07:36:10 PDT 2018


kbobyrev added inline comments.


================
Comment at: clangd/index/dex/Dex.cpp:143
          "There must be no :: in query.");
+  trace::Span Tracer("Dex fuzzyFind");
   FuzzyMatcher Filter(Req.Query);
----------------
sammccall wrote:
> We should attach the query tree to the span here.
> 
> Right now that's not practical as the dump() representation holds the posting lists rather than their token, but maybe add a FIXME?
Yes, that's an interesting topic. I was thinking about better dump format for queries for the `dexp` commands (namely, `find`): right now there's no API to pull even the query dump for the external callers, so this is another problem. For better format, I was thinking about adding either `LABEL` iterator or actually having `StringRef Iterator::label() const;` as most iterators are likely to have one. E.g. PostingList's can store the `Token` reference, but then we're likely to run into the memory issues so it can be disabled in all builds other than `DEBUG`. Other iterators are fine, because they are only constructed once per query and never stored afterwards.

And it would be very useful to see the full query structure for both debugging purposes and for understanding which queries are slow (and why). I thought about measuring distinct queries latency to have better statistics (latency histogram & distributions) to understand how to optimize Dex and improve performance.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D52611





More information about the cfe-commits mailing list