Skip to content

selfcheck.yml: added callgrind step for basic (core) performance tracking - #4171

Merged
danmar merged 3 commits into
cppcheck-opensource:mainfrom
firewave:selfcheck-callgrind
Sep 28, 2022
Merged

selfcheck.yml: added callgrind step for basic (core) performance tracking#4171
danmar merged 3 commits into
cppcheck-opensource:mainfrom
firewave:selfcheck-callgrind

Conversation

@firewave

@firewavefirewave commented Jun 5, 2022

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
CollaboratorAuthor

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
firewaveforce-pushed the selfcheck-callgrind branch 2 times, most recently from 21e2467 to f97165bCompareJune 6, 2022 08:52
@firewave

Copy link
Copy Markdown
CollaboratorAuthor

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
firewaveforce-pushed the selfcheck-callgrind branch from 408b2ed to fa78b64CompareJune 7, 2022 09:27
firewave referenced this pull request Jul 10, 2022
* Optimization: Use Token::eIncDecOp instead of expensive Token::Match calls
Merged from LCppC.
* Small Optimizations: - Moved a std::set that is only need during initialization of SymbolDatabase to function scope - Use std::vector instead of std::list
Merged from LCppC.
* Optimization: Refactorized various Token::Match calls and surrounding conditions
Merged from LCppC.
* Refactorization: Cleanup usage of std::multimap
Merged from LCppC.
@firewave

firewave commented Sep 23, 2022

Copy link
Copy Markdown
CollaboratorAuthor

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

Copy link
Copy Markdown
CollaboratorAuthor

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

@firewave
firewaveforce-pushed the selfcheck-callgrind branch 6 times, most recently from 3a293d1 to 31a5fcfCompareSeptember 27, 2022 11:49
@firewave

Copy link
Copy Markdown
CollaboratorAuthor

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
firewave marked this pull request as ready for review September 27, 2022 20:16
@firewavefirewave changed the title Selfcheck callgrindselfcheck.yml: added callgrind step for basic (core) performance trackingSep 27, 2022
@danmar
danmar merged commit 441f9b9 into cppcheck-opensource:mainSep 28, 2022
@firewave
firewave deleted the selfcheck-callgrind branch September 28, 2022 17:33
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@firewave@danmar