llvm-project
9e5deb96 - [clang-tidy] Speed up `modernize-use-nullptr` (#178829)

Commit
24 days ago
[clang-tidy] Speed up `modernize-use-nullptr` (#178829) As noted in [this comment](https://github.com/llvm/llvm-project/pull/178149#discussion_r2732896149), it appears that registering one `anyOf(a, b, ...)` matcher is generally slower than registering `a, b, ...` all individually. Applying that knowledge to this check gives us an easy 3x speedup: ```txt ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Name --- Status quo: 0.3281 ( 6.1%) 0.0469 ( 5.2%) 0.3750 ( 6.0%) 0.3491 ( 5.5%) modernize-use-nullptr With this change: 0.0938 ( 1.8%) 0.0156 ( 1.8%) 0.1094 ( 1.8%) 0.1260 ( 2.1%) modernize-use-nullptr ``` I'm not exactly sure *why* this works, but it seems pretty consistent. I've seen a similar result trying this with `bugprone-infinite-loop`.
Author
Parents
Loading