[PATCH] D95516: [clang][cli] Benchmark command line round-trip

Jan Svoboda via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 27 04:17:10 PST 2021


jansvoboda11 created this revision.
jansvoboda11 added reviewers: Bigcheese, dexonsmith.
Herald added a subscriber: mgorny.
jansvoboda11 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch adds a micro-benchmark for command line round-tripping.

The hard-coded arguments come from the longest record in LLVM's `compile_commands.json` on Linux.

Results for release build with assertions:

  ------------------------------------------------------------------------
  Benchmark                                 Time           CPU Iterations
  ------------------------------------------------------------------------
  BM_CompilerInvocationNoRoundTrip    2653056 ns    2652398 ns        269
  BM_CompilerInvocationDoRoundTrip    2932063 ns    2931050 ns        239

Results for release build without assertions:

  ------------------------------------------------------------------------
  Benchmark                                 Time           CPU Iterations
  ------------------------------------------------------------------------
  BM_CompilerInvocationNoRoundTrip    2474006 ns    2473101 ns        276
  BM_CompilerInvocationDoRoundTrip    2741366 ns    2740046 ns        259

This is a 10% increase in run-time in both scenarios.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D95516

Files:
  clang/CMakeLists.txt
  clang/benchmarks/CMakeLists.txt
  clang/benchmarks/CompilerInvocationBench.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D95516.319527.patch
Type: text/x-patch
Size: 4573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210127/524503fd/attachment.bin>


More information about the cfe-commits mailing list