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

    <tr>
        <th>Summary</th>
        <td>
            Should clang-tidy support multiple threads?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    ### clang-tidy is not multi-threaded 
`clang-tidy` uses a single thread to run its checks.  Looking at the generated profile data (`--enable-check-profile`), some of these checks take multiple minutes to finish.  For large codebases with critical paths, clang-tidy is spending a lot of time analyzing individual source files which it could likely analyze faster by using multiple threads and running checks in parallel.  

I see that `run-clang-tidy.py` script has a jobs (`-j`) flag, but this is simply spawning multiple clang-tidy processes (which most build systems & CIs will already be doing).  I'm wondering if we should have an implementation of a `-j` flag for clang-tidy itself.

### feature request
After the AST is parsed, it seems like running checks in parallel would make sense and be reasonable to implement.  Is there a design limitation here that has prevented this feature, or has it simply not been proposed or implemented?

### references
This is the only ticket I found that was relevant but did not address the absence of this feature:
https://github.com/llvm/llvm-project/issues/55471
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVM1u4zYQfhr5MrAhy5FjH3RIdxEgQG-7LzASRxJjilQ5lF336TsjKYkXLXopYFim5-_7GaoO5l5lxWH5QOPQd9tkzR0sgw8Jhsklu019JDRkIMu_Z_lLdsy_MuUAExMDAlvfOYIlG1KAOHmwiaHpqbnwDuD3EC6SBJgki6AjTxGTNB5jaK3UGkwIWXGSrtsteawdbefq7Zohgaw4Z8U34DAQhFYbMa0jIOGFFtCjdBusn5JAEyit9ZZ7gfAaIjiMnZQEQzUq9JtNPTTRJtuggxFTzzrhVzl4JG9m8OBEGZ1sBQF6dPe_9H8r4as1k7TgMMWGQAFL9942veggAydnwNkLuftaJznIiSLUd1FRu3yCX2QUXb1RIb0GV5bWC8iI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