Skip to content

Re-use module cache from .build or have a global module cache for background preparation #2428

@ahoppen

Description

@ahoppen

Preparing the BuildServerIntegrationTests target in the SourceKit-LSP target takes 42 seconds on my machine. When setting the module cache path to a module cache generated during a build, this time is reduced to 22 seconds. This means that we can significantly reduce background indexing time by either

  • Sharing the module cache with the build (this won’t have a direct indexing benefit when the user didn’t build the package before opening in VS Code but should have a similar benefit on their first clean build time.
  • Having a global module cache for SourceKit-LSP. I have a strong suspicion that most modules that take long to build are SDK modules that will be used between multiple packages, so this could be a real benefit for indexing, without being a benefit for build times, unless we also consider a global module cache for SwiftPM in general. The main question with a global module cache would likely be to decide how / if we can clean it. An idea would be to delete modules that are older than 1 month and trust that they will be re-generated if still needed.

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