Skip to content

Integrate ctcache to improve build time in industrial_ci #887

@ipa-rar

Description

@ipa-rar

Context
When using clang-tidy as part of the ROS build pipeline, the analysis phase can be quite time-consuming, especially for large C++ packages. Re-running clang-tidy on previously analyzed code can lead to unnecessary overhead and delays. ctcache addresses this by caching results and reusing them for unchanged files.

In our use case, integrating ctcache locally has resulted in a notable reduction in build time by avoiding redundant static analysis operations. This improvement would be beneficial for many users who run industrial_ci in CI environments where build speed is critical.

ctcache workflow

                +-------------------------------+
                |  Start                        |
                +-------------------------------+
                                |
                                v
                +-------------------------------+
                | Parse Command-Line Arguments  |
                +-------------------------------+
                                |
                                v
                +-------------------------------+
                | Generate Hash (Digest)        |
                +-------------------------------+
                                |
                                v
       +------------------[ Yes ]---------------+
       |    Is hash in cache?                   |
       +------------------[ No ]----------------+
        |                                          |
        v                                          v
+---------------------------+           +---------------------------+
| Fetch Cached Result        |           | Run clang-tidy            |
+---------------------------+           +---------------------------+
        |                                          |
        v                                          v
+---------------------------+           +---------------------------+
| Return Cached Output       |           | Save Result in Cache      |
+---------------------------+           +---------------------------+
                                                 |
                                                 v
                                      +---------------------------+
                                      | Return clang-tidy Output   |
                                      +---------------------------+

Feature Request
I'd like to suggest adding support for ctcache to industrial_ci. ctcache significantly improves build times by caching static analysis results from clang-tidy, avoiding repeated analysis of unchanged files.

Discussion
I believe this feature could greatly enhance the efficiency of the industrial_ci pipeline. I would like to hear from the maintainers and the community—would this be a useful addition for others as well? Are there any potential challenges or concerns with adding ctcache support to industrial_ci?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions