Improve performance of SuppressionsList::isSuppressed by returning as soon as a match is found#8668
Conversation
… soon as a match is found. The same is done in the other overloads of the function. By returning immediately when a match is found, heavily improve the performance of CppCheck::CppCheckLogger reportErr function in cases where a lot of errors are being suppressed.
|
Thanks for your contribution. Please provide more details on "heavily improve the performance". It is possible that this is done intentionally here for the This also requires a ticket. |
I ran a test that produced 20755 error messages and the majority of those were suppressed (>99%).
On my setup (Windows 11 and Intel i7-1260p) the total time went down from 1min 32sec to 45sec. I have a support ticket open related to slow performance, but it might not be related to the finding I have made here, so creating another ticket would make sense.
The unmatchedSuppression handling is unaffected by this change. |
|
I missed a side effect in the isMatch function. I will have to investigate what impact this have. |
Improve performance of SuppressionsList::isSuppressed by returning as soon as a match is found.
The same is done in the other overloads of the function. By returning immediately when a match is found, heavily improve the performance of CppCheck::CppCheckLogger reportErr function in cases where a lot of errors are being suppressed.