OneMoreGres / qtc-cppcheck

Qt Creator Cppcheck integration plugin [deprecated]
MIT License
126 stars 37 forks source link

Analysis of project with v4.5.0 (Windows) is significantly slower than CppCheck GUI #38

Closed cchambers1982 closed 6 years ago

cchambers1982 commented 6 years ago

I took the 4.5.0 release for Windows and integrated it with Qt Creator 4.5.0 (x86) and CppCheck v1.81 on Windows 10 (x64). The analysis is notably slower than with 4.3.0 and the same version of CppCheck, and with the CppCheck GUI. Both of those take around 10 minutes with my solution, but with v4.5.0 I gave up after 20 minutes at 10% done.

OneMoreGres commented 6 years ago

Can't inspect precisely right now (away), but there are some questions:

Also note that plugin analyzes header files explicitly, while cppcheck-gui only processes them if they are included in some checked source (if i remember right). So plugin should always work slower then cppcheck-gui.

I'll be able to check it by myself only some days later.

cchambers1982 commented 6 years ago

Hey Sergey,

Thanks for your response. To answer your questions:

4.3.0: Starting CppChecker with:C:/Program Files (x86)/Cppcheck/cppcheck.exe, --enable=warning,style,performance,portability,information,missingInclude,unusedFunction --template={file},{line},{severity},{id},{message} --file-list=C:/Users/cchambers/AppData/Local/Temp/qtcreator.H17816 --includes-file=C:/Users/cchambers/AppData/Local/Temp/qtcreator.I17816

4.5.0: Starting CppChecker with:C:/Program Files (x86)/Cppcheck/cppcheck.exe, --enable=warning,style,performance,portability,information,missingInclude,unusedFunction --template={file},{line},{severity},{id},{message} --file-list=C:/Users/cchambers/AppData/Local/Temp/qtcreator.B16232 --includes-file=C:/Users/cchambers/AppData/Local/Temp/qtcreator.H16232

image

...so I would have thought they'd be comparable.

I also take your point about the plugin being slower than the GUI, however, considering the plugin at 4.3.0 and the GUI operate at roughly the same speed but 4.5.0 is much, much slower than both I'd say it's more likely there's an issue with the 4.5.0 plugin.

Thank you again for your input.

OneMoreGres commented 6 years ago

Just checked it. 4.3.0 and 4.5.0 works same for me. Unfortunately both are slow on large codebase (qt-creator) :(

But there are some nuances:

So, back to your situation. Was includes file really empty in both cases (4.3.0/4.5.0)? It should be filled with directories, containing checked files. If it was empty - i don't know how to reproduse your issue. If not - it explains long file processing (cppcheck have to check a lot of paths to find (or not) includes). But doesn't lead to proper sollution, since that file is here for a reason :)

cchambers1982 commented 6 years ago

Hi Sergey. So sorry for the delay in responding to you.

Thank you for the hints. I added the exclusion for header files but it didn't appear to exclude them during the check, and indeed was still very slow to process.

image

I was sure that includes-files was empty last time, but I just re-checked and this time it's not so perhaps I made a mistake somewhere along the line. There are some 70 lines of directory paths in there now, all part of my solution.

OneMoreGres commented 6 years ago

Hello again.

I'll dig into cppcheck's sources later. Maybe then i'll find the way to handle such situations properly.

Ignore patterns means that matched files will not be passed to cppcheck cli. But if one of passed files uses (includes) some of them, cppcheck will check it anyway.

Btw check for unused functions disables threading.

OneMoreGres commented 6 years ago

Try this version. Changes:

QtcCppcheck-4.5.0-win1.zip

cchambers1982 commented 6 years ago

Hi Sergey, this version is much, much faster! Thank you.

prepas commented 6 years ago

@cchambers1982 I have the error: C:\Qt\Qt5.7.0\Tools\QtCreator-4.5.0\lib\qtcreator\plugins\QtcCppcheck4.dll: Cannot load library C:\Qt\Qt5.7.0\Tools\QtCreator-4.5.0\lib\qtcreator\plugins\QtcCppcheck4.dll: Unknown error 0x000000c1.

What is wrong? I use Qt Creator 4.5.0 and I've downloaded QtcCppcheck-4.5.0-win1.zip.

OneMoreGres commented 6 years ago

@prepas Hi. Looks like there is something wrong with your Qt version. Qt Creator 4.5.0 is build with Qt 5.10, but it tries to load 5.7 version. Have you installed it via qt online installer? I test plugins only for that version.

prepas commented 6 years ago

No, I use Qt Creator 4.5.0 & Qt 5.7.0

OneMoreGres commented 6 years ago

If you use qt creator different to one from qt online installer, then you likely should rebuild plugin by yourself.