[all-commits] [llvm/llvm-project] 6506f9: [clang-tidy] Prefer the faster LLVM ADT sets and m...
Victor Chernyakin via All-commits
all-commits at lists.llvm.org
Thu Jan 8 13:31:44 PST 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6506f92844cfc56f84d1edc42034369eb3369111
https://github.com/llvm/llvm-project/commit/6506f92844cfc56f84d1edc42034369eb3369111
Author: Victor Chernyakin <chernyakin.victor.j at outlook.com>
Date: 2026-01-08 (Thu, 08 Jan 2026)
Changed paths:
M clang-tools-extra/clang-tidy/altera/IdDependentBackwardBranchCheck.h
M clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
M clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.h
M clang-tools-extra/clang-tidy/google/AvoidNSObjectNewCheck.cpp
M clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp
M clang-tools-extra/clang-tidy/misc/NewDeleteOverloadsCheck.h
M clang-tools-extra/clang-tidy/misc/UnusedParametersCheck.cpp
M clang-tools-extra/clang-tidy/modernize/UseEqualsDefaultCheck.cpp
M clang-tools-extra/clang-tidy/readability/BracesAroundStatementsCheck.h
M clang-tools-extra/clang-tidy/readability/NonConstParameterCheck.h
M clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
Log Message:
-----------
[clang-tidy] Prefer the faster LLVM ADT sets and maps over `std::` ones (#174357)
The LLVM docs give a good description of [why `std::` containers are
slower than LLVM
alternatives](https://llvm.org/docs/ProgrammersManual.html#set). To see
what difference switching to the LLVM ones made, I [reused the
approach](https://github.com/llvm/llvm-project/pull/174237#issuecomment-3707395449)
of measuring how long it takes to run all checks over all standard
library headers (MSVC STL in my case). Using hyperfine (which basically
runs a program multiple times and computes how long it took):
```sh
hyperfine --shell=none './build/release/bin/clang-tidy --checks=* all_headers.cpp -header-filter=.* -system-headers -- -std=c++23'
```
...the results were:
Before:
```
Benchmark 1: ./build/release/bin/clang-tidy --checks=* all_headers.cpp -header-filter=.* -system-headers -- -std=c++23
Time (mean ± σ): 53.253 s ± 0.089 s [User: 46.480 s, System: 6.748 s]
Range (min … max): 53.118 s … 53.440 s 10 runs
```
After:
```txt
Benchmark 1: ./build/release/bin/clang-tidy --checks=* all_headers.cpp -header-filter=.* -system-headers -- -std=c++23
Time (mean ± σ): 51.798 s ± 0.126 s [User: 45.194 s, System: 6.575 s]
Range (min … max): 51.620 s … 51.995 s 10 runs
```
...which is a nice little speedup for just switching some containers. I
didn't investigate which checks in particular were the source of the
speedup though.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list