After updating from 2.3 to 2.4, execution time on our code base has increased from ~70 minutes to ~200 min.
The main culprits seem to be simplifyTokens1 and simplifyTemplates.
v2.3:
Sorry, the code base is proprietary and fairly large.
Doesn't this problem also show up in DACA@home? Although I don't know if you can compare runtimes against 2.3 there.
I guess I could run a nightly build if it helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, I ran cppcheck with your patch applied (compiled with VS2019 in Release mode), and there was no improvement in runtime (~210+ min vs 200 min before).
Maybe I'll be able to run it under a profiler at some point to see where the bottlenecks are.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the same performance issue with my code base.
I ran Intel VTune between cppcheck 2.3 and cppcheck 2.4 compiled with VS2019 + Release with debug info
Top Hotspots
cppcheck 2.3
Function Module CPU Time
Token::multiCompare cppcheck-core.dll 197.585s
Token::Match cppcheck-core.dll 58.073s
multiComparePercent cppcheck-core.dll 33.011s
malloc_base ucrtbase.dll 19.711s
TemplateSimplifier::expandTemplate cppcheck-core.dll 17.934s [Others] N/A* 154.145s
cppcheck 2.4
Function Module CPU Time
ScopeInfo3::findInChildren cppcheck-core.dll 848.035s
Token::multiCompare cppcheck-core.dll 253.432s
ScopeInfo3::findScope cppcheck-core.dll 137.450s
Token::Match cppcheck-core.dll 89.093s
malloc_base ucrtbase.dll 41.890s [Others] N/A* 266.203s
findInChildren & findScope are called by Tokenizer::simplifyUsing
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
simplifyUsing was changed in 2.4 to do better type lookup but the type lookup is slower. We need to change simplifyUsing to do scope caching and better type lookup like we did in templateSimplifier.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After updating from 2.3 to 2.4, execution time on our code base has increased from ~70 minutes to ~200 min.
The main culprits seem to be
simplifyTokens1
andsimplifyTemplates
.v2.3:
v2.4:
Note that the output is from a multi-threaded run.
Last edit: CHR 2021-03-22
Can you provide some example code? This is hard to fix without an example.
Doe this patch help?
Sorry, the code base is proprietary and fairly large.
Doesn't this problem also show up in DACA@home? Although I don't know if you can compare runtimes against 2.3 there.
I guess I could run a nightly build if it helps.
So, I ran cppcheck with your patch applied (compiled with VS2019 in Release mode), and there was no improvement in runtime (~210+ min vs 200 min before).
Maybe I'll be able to run it under a profiler at some point to see where the bottlenecks are.
I have the same performance issue with my code base.
I ran Intel VTune between cppcheck 2.3 and cppcheck 2.4 compiled with VS2019 + Release with debug info
Top Hotspots
cppcheck 2.3
Function Module CPU Time
Token::multiCompare cppcheck-core.dll 197.585s
Token::Match cppcheck-core.dll 58.073s
multiComparePercent cppcheck-core.dll 33.011s
malloc_base ucrtbase.dll 19.711s
TemplateSimplifier::expandTemplate cppcheck-core.dll 17.934s
[Others] N/A* 154.145s
cppcheck 2.4
Function Module CPU Time
ScopeInfo3::findInChildren cppcheck-core.dll 848.035s
Token::multiCompare cppcheck-core.dll 253.432s
ScopeInfo3::findScope cppcheck-core.dll 137.450s
Token::Match cppcheck-core.dll 89.093s
malloc_base ucrtbase.dll 41.890s
[Others] N/A* 266.203s
findInChildren & findScope are called by Tokenizer::simplifyUsing
simplifyUsing
was changed in 2.4 to do better type lookup but the type lookup is slower. We need to changesimplifyUsing
to do scope caching and better type lookup like we did intemplateSimplifier
.