In clang, the output of -ftime-report and -ftime-report-json is somewhat large; for a hello world program built with -O3, -ftime-report outputs ~30K and -ftime-report-json outputs ~62K:
$ bin/clang++ -o /dev/null -ftime-report-json ~/hello.cpp -O3 2>&1 | wc -m
62302
$ bin/clang++ -o /dev/null -ftime-report-json ~/hello.cpp -O3 2>&1 | wc -m
62302
This is quite large, and I’ve been thinking of ways to reduce the output. One PR that I have been working on ([Timers] Add a flag to set a minimum timer value for printing by alanzhao1 · Pull Request #139306 · llvm/llvm-project · GitHub) adds a flag that sets a minimum value a timer must have before it gets printed. However, @hansw2000 pointed out in a comment that an alternative would be to set a flag that only prints the top X timers. What do other folks in the LLVM community think?