<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57527>57527</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Performance regression with clang-tidy-15
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          firewave
      </td>
    </tr>
</table>

<pre>
    Using `clang-tidy-14` the step with the analysis in the GitHub Action of our project took about 8 minutes. Switching to `clang-tidy-15` it now takes at least 13 minutes. `run-clang-tidy-*` is being used with `-j2` (actually `nproc` but that resolves to `2`). I checked several builds to make sure it wasn't just an odd-one-out slow runner.

We only recently did the switch and the first version we were using is `15.0.0~++20220825073216+12f27d8bef93-1~exp1~20220825073228.37`. The latest build which still experiences this used `15.0.0~++20220902063112+11ba13a62506-1~exp1~20220902063219.49`. The last version used of the prior version was `14.0.6~++20220816122211+f28c006a5895-1~exp1~20220816122246.108`.

We are using the packages from https://apt.llvm.org on ubuntu 22.04. The project in question in https://github.com/danmar/cppcheck.

The `.clang-tidy` configuration is the same for both (obviously `clang-tidy-15` comes with additional/improved checks):
```yaml
---
Checks:          '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-named-parameter,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-performance-unnecessary-value-param,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-readability-non-const-parameter,-misc-non-private-member-variables-in-classes,-bugprone-suspicious-string-compare,-clang-analyzer-*,-bugprone-signed-char-misuse,-readability-make-member-function-const,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-bugprone-suspicious-include,-modernize-replace-random-shuffle,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness'
WarningsAsErrors: '*'
CheckOptions:
  - key:             misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
    value:           '1'
```

We are also leveraging it to report compiler warnings. I don't have the general list of parameters handy right now. There's a few slightly adjustments per file (via CMake) but it is about the same for most of the files.

I know there is some option to collect the timing information for each analysis but it is not documented and I no longer remembered where I read about it. If you point me to it I will happily provide that data.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVV8mS4zYS_RrVBQEFSe0HHcpte6YOjnHELD6DIEihCwRoLFLLXz8vQVFr90RMh6KLIIHMl8tLZNauOe__HbTt2GxdSCNsx6NuzrxcYs3iQbEQ1cBOOh7ySlhhzkEHpm1e_03Hv6eavcuonWWuZS55Nnj3VcnIonOfTNQuRbZlvbYpqjBn_4QweSCV0T1rXZFWHZl1JxbFpwpMRGaUCJGVi5sI7PLJ8ruTs-o9Hw2sViQ6BdWMqPGaf63o46zaChmTMOZMby1gSnpfA188QJFXwZkjlI7A6NCs2s3ZB5MHJT8hMaij8sLgiDZN3tcDJQvJK4J9EsHOqk1kXxMQCzikabizipMLgoFRgG2Vn8-Kn2fF-_j_H4o5C0heSWUjH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