You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
clang-tidy check misc-unused-using-decls appears to be quite slow #72300
The misc-unused-using-decls check constantly comes up as one of the top 3 expensive checks in our code base (it usually takes about 5% of the total time). Considering it is not providing that much in terms of its findings compared to other checks it seems a bit excessive.
Lot of code, lot of using directives. This check need to be re-written to use RecursiveASTMatcher like bugprone-reserved-identifier were. misc-unused-using-decls would also benefit from ignoring system headers, and there were WIP change for that, but it stuck as amount of reviewers is ... small.
As for bugprone-standalone-empty, that just need some tuning like TK_IgnoreUnlessSpelledInSource.
From "priority" point of view there are other changes like https://reviews.llvm.org/D150126 that would bring bigger improvements over all checks, not only this one. And other issues. When your points are valid, I just don't think that anyone will spend time on this in near time, unless issue can be reproduced on some bigger files where this check would take more than ~20s, otherwise that's just a noise caused by simply cost of an AST processing.
Activity
sean-mcmanus commentedon Nov 14, 2023
@firewave Our team saw the same issue with our project (so we disabled that check in certain scenarios).
PiotrZSL commentedon Nov 14, 2023
That's on LLVM 17/18 ? Based on how this check is implemented, yes it can be slow & buggy. I will see what I can do.
sean-mcmanus commentedon Nov 14, 2023
@PiotrZSL I used clang-tidy 17.0.2.
firewave commentedon Nov 14, 2023
My numbers are from LLVM 18.
firewave commentedon Jan 24, 2024
Looks like this was fixed by #78231.
CC @HerrCai0907
HerrCai0907 commentedon Jan 24, 2024
@firewave Could you re-benchmark with current version?
firewave commentedon Jan 24, 2024
I am still seeing this:
I am using the binaries from
apt.llvm.shand the commit hash in the version indicates that the changes are included.Ubuntu clang version 18.0.0 (++20240123053045+8ed1291d96ea-1~exp1~20240123173204.910)It looks like it is the wrong version but
apt.llvm.shhas not yet been adjusted for the version bump. That usually takes a few days.PiotrZSL commentedon Jan 24, 2024
800ms for a clang-tidy check is not much, depend on file size.
firewave commentedon Jan 24, 2024
You sure? If you would have 100 of such checks a single file would take 80000ms. But we digress.
The percentage still matches what I reported in the initial report. And it is still one of the slowest checks.
PiotrZSL commentedon Jan 24, 2024
Lot of code, lot of using directives. This check need to be re-written to use RecursiveASTMatcher like bugprone-reserved-identifier were. misc-unused-using-decls would also benefit from ignoring system headers, and there were WIP change for that, but it stuck as amount of reviewers is ... small.
As for bugprone-standalone-empty, that just need some tuning like TK_IgnoreUnlessSpelledInSource.
From "priority" point of view there are other changes like https://reviews.llvm.org/D150126 that would bring bigger improvements over all checks, not only this one. And other issues. When your points are valid, I just don't think that anyone will spend time on this in near time, unless issue can be reproduced on some bigger files where this check would take more than ~20s, otherwise that's just a noise caused by simply cost of an AST processing.
firewave commentedon Jan 18, 2025
Possibly improved by #123454.
vbvictor commentedon Aug 25, 2026
Please re-evaluate result with newer version. Feel free to reopen issue