[PATCH] D60609: Use native llvm JSON library for time profiler output

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 10:34:07 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Support/TimeProfiler.cpp:83-86
+    json::Array Events;
 
     // Emit all events for the main flame graph.
     for (const auto &E : Entries) {
----------------
anton-afanasyev wrote:
> lebedev.ri wrote:
> > There is no `reserve()` function in `json::Array`, thus you end up doing the memory dance *every* entry. :/
> > (alloc larger, move, delete previous)
> > I suspect this accounts for **majority** of the extra cost, although not all of it.
> Good point to change in json lib.
If you don't intend to look into that (should be rather trivial),
can you please at least raise a bug about this, with those perf numbers?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60609





More information about the llvm-commits mailing list