Skip to content

Disk cache and clean rebuild speed #1174

Open

Description

@Meinersbur

I noticed that sccache is a lot slower that ccache on a clean rebuild (make clean && make). I think this is due to the following effects:

  1. In addition to hashing the preprocessor output, ccache also collects all preprocessor dependencies (either from parsing the preprocessor's line directive or the output of -MD), then hashes those files and writes them into the cache as a "manifest" file. Next time ccache gets invoked on the file, it looks whether any of those file have changed and if not, doesn't need to invoke the preprocessor. Ideally, it doesn't even need to rehash but consider file metadata whether a file has changed.

  2. ccache has an option that stores the object files uncompressed. On a cache hit, it just creates a hard link (or clone on CoW file systems) to that file. This is also friendler for SSDs for not wasting write cycles. Note the some build systems may modify files inplace (eg. when executing strip), so ccache removes write permission to hardlinked files in the cache.

Could those two features also be implemented in sccache?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions