That is not expected in general. But I think it sometimes happen in a few cases.
We keep improving the parser and that means more analysis is done.. then getting a corresponding time increase is something we expect. This primarily affects C++ code that uses templates. Does that sound like your code?
Could you run cppcheck with "unofficial" flag --showtime=summary? That can give us some details.
Last edit: Daniel Marjamäki 2019-02-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The changes for these software versions resulted in a significant difference for the shown run time behaviour.
Are you becoming more interested in precise software profiling?
Last edit: Markus Elfring 2019-03-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the stats. Yes now we can see that the "parsing" got a lot slower.
To make it more deterministic. Please remove "-f" or "--force" if you use that. Please use at least one "-D"..
I don't want to say that it is "expected". But I do not know how to determine if this is some problem that should be looking into.. I assume your code is not open source?
I don't remember if there is some useful debug output that we can use here. If there are not.. Would you be willing to run patched Cppcheck also that shows if there are lots of skipped code? You can easily compile Cppcheck yourself if you want..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, our code is not open source. We do not user -f option. On mondey I will talk with our main developper about -D option because I'm not a developper and don't know what macro can be defined.
I can run patched cppcheck
I also see there are options --debug-normal and --debug-simplified, i will try to compare output from different versions
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like I found candidate for slow parsnig (see attachment)
./cppcheck --showtime=top5 ~/downloads/btflag_test.cpp
v1.81 - Tokenizer::simplifyTokens1: 0.028685s
v1.82 - Tokenizer::simplifyTokens1: 0.041139s
~ +30%
thanks. I would have preferred a larger time difference than +30%. Didn't you find such candidate at all? Or are those source code that you can't share?
It is good that you can run a patched cppcheck. To start with I am thinking we can try to achieve more detailed measurements.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Our project is too big (860 files), and I don't know how to deremine wich files are most slow. I took one file, and began to check all its includes. The includes count is very big, and after 1 hour I ended with many files, each has a small additional time to check.
Is it possible to get more detailed information about Tokenizer to deremine what part of file (or what icluded file or template) was slowest?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
860 cpp and h files. Size from 20 bytes to 73kB. Total size is 20MB.
Checking biggest file (72KB) takes 0,1second, while checking 1KB file take 4 seconds. Little file can include 100 other files, so file size doesn't matter.
Even having found the most slover cpp file the question will still be open, because it can contain more then 100 includes. Checking of .h files is very quick, but checking of cpp file that only include .h files is much slover
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Have you tried the latest version (1.87) or git head? 1.82 is over a year old. Improvements and fixes are only made to the latest version.
I would expect newer versions to be slower because we are adding more checks and improving the accuarcy of the checks. Both generally require more CPU time. However a large change may be due to a bug but that would probably effect specific files rather than a overall slowdown.
Is your source code open source? Performance is highly dependent on the source code being checked.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I first upgraded to 1.87 (from 1.80) and noticed a slowdown. I then narrowed it down to an upgrade from 1.81 to 1.82 in case it helped isolate the change.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I doubt we will be able to "solve" this by making full Cppcheck analysis drastically faster. unless we find some horrible hotspot. I believe it's unlikely that there is a horrible hotspot.
Do you use the released binaries or did you compile yourself? It is very important that our "match compiler" is used during compilation.
Maybe you need some way to tweak Cppcheck analysis? Maybe there are some analysis steps that does not give you enough good results.
You might be interested to have a "limited" analysis at daytime and then a "full" analysis in nightly builds?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For instance we could have a "fast" option that will skip all template code. I wonder, how interesting does such option sound if it means significantly faster analysis?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi! I just update my cppcheck from 1.77 to 1.86 and noticed then new version is 4 times slover.
I find that 1.82 is slover then 1.81.
and
Is this expected ?
That is not expected in general. But I think it sometimes happen in a few cases.
We keep improving the parser and that means more analysis is done.. then getting a corresponding time increase is something we expect. This primarily affects C++ code that uses templates. Does that sound like your code?
Could you run cppcheck with "unofficial" flag
--showtime=summary
? That can give us some details.Last edit: Daniel Marjamäki 2019-02-01
Yes, our code is c++ with templates
(when using --report-progress I see often
progress: TemplateSimplifier::simplifyTemplateInstantiations() 81% )
top 5 for 1.86:
top 5 for 1.82
top 5 for 1.81:
what kind of statistics do you need?
I just run cppcheck on project folder, so I dont have processing time for each file, but I will try to measure it
Last edit: Markus Elfring 2019-02-01
1.81:
1.86:
I am confused about such difference. As far as I remember we have not made drastic changes in this part of Cppcheck.
The changes for these software versions resulted in a significant difference for the shown run time behaviour.
Are you becoming more interested in precise software profiling?
Last edit: Markus Elfring 2019-03-01
Thanks for the stats. Yes now we can see that the "parsing" got a lot slower.
To make it more deterministic. Please remove "-f" or "--force" if you use that. Please use at least one "-D"..
I don't want to say that it is "expected". But I do not know how to determine if this is some problem that should be looking into.. I assume your code is not open source?
I don't remember if there is some useful debug output that we can use here. If there are not.. Would you be willing to run patched Cppcheck also that shows if there are lots of skipped code? You can easily compile Cppcheck yourself if you want..
Do you need any more help for the systematic comparison of run time characteristics?
Yes, our code is not open source. We do not user -f option. On mondey I will talk with our main developper about -D option because I'm not a developper and don't know what macro can be defined.
I can run patched cppcheck
I also see there are options --debug-normal and --debug-simplified, i will try to compare output from different versions
Looks like I found candidate for slow parsnig (see attachment)
./cppcheck --showtime=top5 ~/downloads/btflag_test.cpp
v1.81 - Tokenizer::simplifyTokens1: 0.028685s
v1.82 - Tokenizer::simplifyTokens1: 0.041139s
~ +30%
thanks. I would have preferred a larger time difference than +30%. Didn't you find such candidate at all? Or are those source code that you can't share?
It is good that you can run a patched cppcheck. To start with I am thinking we can try to achieve more detailed measurements.
Would you like to improve the software build infrastructure for corresponding program profiling anyhow?
Our project is too big (860 files), and I don't know how to deremine wich files are most slow. I took one file, and began to check all its includes. The includes count is very big, and after 1 hour I ended with many files, each has a small additional time to check.
Is it possible to get more detailed information about Tokenizer to deremine what part of file (or what icluded file or template) was slowest?
I would prefer to interpret the software situation in more constructive ways.
Efficient data processing will be more helpful here, won't it?
860 cpp and h files. Size from 20 bytes to 73kB. Total size is 20MB.
Checking biggest file (72KB) takes 0,1second, while checking 1KB file take 4 seconds. Little file can include 100 other files, so file size doesn't matter.
Even having found the most slover cpp file the question will still be open, because it can contain more then 100 includes. Checking of .h files is very quick, but checking of cpp file that only include .h files is much slover
Other software details will become more interesting then, won't they?
Do you recognise any special code patterns in the source files with remarkable data processing durations?
Here are the results for the supplied file for the last 8 versions:
1.87 is the first version that can fully process and understand the supplied file. It is also the slowest.
Hi. Any news?
I'm also seeing a big slowdown with CppCheck 1.82, but I can see huge timing gaps in the output:
1.81
[20:55:20][Step 1/2] in directory: D:\Data\TeamCity\buildAgent\work\Facade_0.0.0
[20:55:33][Step 1/2] Checking Utils\Reader.cpp Debug|Win32...
...
[20:55:33][Step 1/2] Checking Facade\AlgoCSAFOSystems.cpp Release|x64...
[20:55:34][Step 1/2] Checking Facade\AlgoCSAForTrades.cpp: _MSC_VER=1900;_WIN32=1;...
1.82
[20:39:42][Step 1/2] in directory: D:\Data\TeamCity\buildAgent\work\Facade_0.0.0
[20:42:09][Step 1/2] Checking Utils\Reader.cpp Debug|Win32...
...
[20:42:09][Step 1/2] Checking Facade\AlgoCSAFOSystems.cpp Release|x64...
[20:44:46][Step 1/2] Checking Facade\AlgoCSAForTrades.cpp: _WIN32=1;...
I'd really like to see this resolved so I can upgrade - it's not practical as it stands.
If there's any log details I can collect please let me know. I can't share the source code though.
Have you tried the latest version (1.87) or git head? 1.82 is over a year old. Improvements and fixes are only made to the latest version.
I would expect newer versions to be slower because we are adding more checks and improving the accuarcy of the checks. Both generally require more CPU time. However a large change may be due to a bug but that would probably effect specific files rather than a overall slowdown.
Is your source code open source? Performance is highly dependent on the source code being checked.
I first upgraded to 1.87 (from 1.80) and noticed a slowdown. I then narrowed it down to an upgrade from 1.81 to 1.82 in case it helped isolate the change.
I doubt we will be able to "solve" this by making full Cppcheck analysis drastically faster. unless we find some horrible hotspot. I believe it's unlikely that there is a horrible hotspot.
Do you use the released binaries or did you compile yourself? It is very important that our "match compiler" is used during compilation.
Maybe you need some way to tweak Cppcheck analysis? Maybe there are some analysis steps that does not give you enough good results.
You might be interested to have a "limited" analysis at daytime and then a "full" analysis in nightly builds?
For instance we could have a "fast" option that will skip all template code. I wonder, how interesting does such option sound if it means significantly faster analysis?