cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

Selfcheck callgrind

Open firewave opened this issue 3 years ago • 2 comments

Using the unusedFunction self-check for profiling gives us a very basic case which involves the core functionality without the valueflow or most of the checks which should be a pretty good canary for speed improvements/regressions. Although the Ir does not translate directly into actual real time speed it would affects other jobs like the sanitized builds and would give an indication if it has any impact at all.

firewave avatar Jun 05 '22 10:06 firewave

Okay - the amount it takes to finish is actually acceptable (a bit over 20 minutes). Using clang should should make things even better. But using the current code base for makes no sense since the code we scan would change with every commit. So it needs to be a fixed corpus - like a release package of our code.

firewave avatar Jun 05 '22 14:06 firewave

With Clang it's less than 20 minutes. We could make it even faster by introduced a hack that we actually only perform the unusedFunction check but I think having some checks executed helps with the usefulness of the callgrind data.

firewave avatar Jun 07 '22 09:06 firewave

I think this job also makes sense without have the baseline comparison so we simply collect the performance metric so we can check which commit might have affected the performance in retrospect.

The build takes about 14 minutes which is among the slowest in our CI but still a reasonable amount of time. If we are able to optimize a few things that will obviously be faster. Maybe there's also a way to tune this a bit.

firewave avatar Sep 23 '22 12:09 firewave

The main offender is https://trac.cppcheck.net/ticket/10663 which takes up almost 17% of the whole Ir.

firewave avatar Sep 23 '22 13:09 firewave

This is ready for review now. The time it takes (~15 minutes) is reasonable and it will help to track the (core) performance which should only increase.

It currently sits at 86,627,730,594 but with all the currently pending performance improvements/hacks applied it will soon fall below 80m.

firewave avatar Sep 27 '22 20:09 firewave