Skip to content

Conversation

@firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

firewave commented Jul 22, 2024

I will provide rough write-ups of all the sections (especially just a mind dump) I already listed soon. Along with some related tickets as well as PRs.

If you have additional sections to add add a comment and I will incorporate them.

@firewave
Copy link
Collaborator Author

firewave commented Aug 8, 2024

Content-wise I am done with this for now. So feel free to provide feedback on it.

I will still address the TODOs by filing tickets and publishing a few PRs and will mark it ready for review afterwards.

@firewave firewave force-pushed the tuning branch 4 times, most recently from b1e6bfd to bb98e61 Compare August 9, 2024 07:21
@firewave firewave marked this pull request as ready for review April 28, 2025 13:00
@firewave
Copy link
Collaborator Author

firewave commented Apr 28, 2025

I cannot be bothered to deal with the TODOs right now...so just let's get it in.

@firewave firewave merged commit 2d6dc91 into danmar:main May 6, 2025
@firewave
Copy link
Collaborator Author

firewave commented May 6, 2025

@chrchr-github Care for a post-commit review?


### Use Multiple Jobs

By default only a single process/thread is being used. You might to scale this up using the `-j` CLI option. Please note that specifying a value that will max out your systems resources might have a detrimental effect.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can increase this value by passing...


### Use A Different Threading Model

When using multiple job for the analysis (see above) on Linux it will default to using processes. This is done so the analysis is not aborted prematurely aborted in case of a crash.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: aborted prematurely aborted


## Tuning At Build-Level

It is most likely that a pre-built binary is being used - either an official one or one provided by the packaging manager of my operating system.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of your operating system

Note: I'm not seeing the "Suggest change" icon for some reason.


## Reporting Issues

If you encounter a file which has an unreasonable slow analysis please consider reporting this as an issue.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unreasonably


If you encounter a file which has an unreasonable slow analysis please consider reporting this as an issue.

Also consider reporting major upticks in the runtime of the analysis after updating to a newer version. Some of these might be expected as the analysis is constantly improved but out-of-the-box we still need aim for reasonable times.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: need aim

Unfortunately it has overhead because of a suboptimal implementation and the fact that data needs to be transferred from the child processes to the main process.
So if you do not require the additional safety you might want to switch to the usage of thread instead using `--executor=thread`.

Note: For Windows binaries we currently do not provide the possibility of using processes so this does not apply.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Windows binaries always use threads, so this does not apply.


### Specify A Build Dir

Using the `--cppcheck-build-dir` allows you to perform incremental runs which omit files which have not been changed.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably mention the need to combine -j with --cppcheck-build-dir for certain checks (unusedFunction?)

If your code base contains files which rarely change (e.g. local copies of external dependencies) or you have generated files (e.g. `moc_*.cpp` for Qt projects) you might consider excluding these from the analysis.
This can be done by using the `-i` option on the CLI, `<ignore>` in GUI projects or by including them to begin with into the files passed to the analysis.

Depending on your setup you might also consider to scan these files in a less frequent run (e.g. only when the files have changed or Cppcheck was updated).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

files less often (...)

Sign up for free to 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.

3 participants