Skip to content

Conversation

@Ryu0118
Copy link
Collaborator

@Ryu0118 Ryu0118 commented Nov 26, 2025

I introduce caching system for PackageResolver to improve performance by caching resolved package

Motivation

Previously, Scipio depended on SwiftPM and used its APIs directly for package resolution, which was efficient. However, after #208 , Scipio introduced its own package resolution logic independent of SwiftPM. This new approach executes swift package resolve (equivalent to the previous resolution) and swift package dump-package for every checked-out repository, which introduced performance issues.

To address this, we cache the resolved packages (array of ResolvedPackage) using the originHash from Package.resolved as the cache key.

Changes

  • Implement LocalDiskCacheStorage conforming to ResolvedPackagesCacheStorage
  • Add PackageResolver.CacheSystem to manage caching and restoration across multiple storage backends according to the policy
  • Integrate PackageResolver.CacheSystem into PackageResolver to store and retrieve resolved package data.
  • Rename CacheStorage to FrameworkCacheStorage with deprecation alias
  • Add unit tests for PackageResolver.CacheSystem

@Ryu0118 Ryu0118 marked this pull request as ready for review December 4, 2025 09:44
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.

1 participant