I plan to look at the performance of Cppcheck in the next couple of weeks.
I hope it will be possible to speedup the parser. For C code I think it should be possible to skip some expensive parsing - for instance the name lookups in setVarId and simplifyTypedef could be simplified.
But I also think it should be possible to limit analysis. If a file normally takes 10 minutes to scan and the user for example wants it to take just ~30 seconds.. then I would like to be able to be flexible and provide some analysis in 30 seconds also. That is still a very long time to a computer.
Firewave made a PR not long ago to skip the valueflow. I would think an option for that would also fit well.
I don't know how to configure this but do you have some opinions. Would it be a good idea to add some --performance= option.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can't remember what was the last cppcheck version I flame graphed. From what I remember any any of the valve flow function that ended up calling updateRange had the highest run times. If you were looking to make a value flow lite option I would look there. When I ran the flame graphs on some of the Daca runs that were taking a lot of time to complete there was another path that looked odd to me, but I never got the time to look into it. If I get some time tomorrow I will run the flame graphs for the latest release and post them to this thread.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I haven't had too much time to look at the flame graphs yet, but I figure it was best to share them. I did seem some strange things in them, but need more time to look at them, but it still looks like most time is spent in the value flow set values part of the code base.
I plan to look at the performance of Cppcheck in the next couple of weeks.
I hope it will be possible to speedup the parser. For C code I think it should be possible to skip some expensive parsing - for instance the name lookups in setVarId and simplifyTypedef could be simplified.
But I also think it should be possible to limit analysis. If a file normally takes 10 minutes to scan and the user for example wants it to take just ~30 seconds.. then I would like to be able to be flexible and provide some analysis in 30 seconds also. That is still a very long time to a computer.
Firewave made a PR not long ago to skip the valueflow. I would think an option for that would also fit well.
I don't know how to configure this but do you have some opinions. Would it be a good idea to add some
--performance=
option.I can't remember what was the last cppcheck version I flame graphed. From what I remember any any of the valve flow function that ended up calling updateRange had the highest run times. If you were looking to make a value flow lite option I would look there. When I ran the flame graphs on some of the Daca runs that were taking a lot of time to complete there was another path that looked odd to me, but I never got the time to look into it. If I get some time tomorrow I will run the flame graphs for the latest release and post them to this thread.
I have attached a tar file with all the svg files from the flame graphs that I have run on latest version of cppcheck 2.9.
This is the basics of the bash script I used. So you can see what code the flame graph is for.
This is how I build cppcheck
I haven't had too much time to look at the flame graphs yet, but I figure it was best to share them. I did seem some strange things in them, but need more time to look at them, but it still looks like most time is spent in the value flow set values part of the code base.