Skip to content

SwiftPM: 2x faster resolves, 3x smaller disk footprint #5322

@kemchenj

Description

@kemchenj

https://forums.swift.org/t/swiftpm-2x-faster-resolves-3x-smaller-disk-footprint/85750

天下苦 SwiftPM 久已,终于有人出手优化 SwiftPM 的速度了,主要逻辑是:

  1. 通过 git ls-remote --tags 方式去直接获取所有版本
  2. 通过 HTTP 接口下载 Package.swift 文件去获取对应的依赖版本
  3. 通过 HTTP 接口下载对应版本代码的 zip 包

上面提到的 HTTP 接口都是使用的 GitHub/GitLab/... 的接口,所以可以理解为是给这些主流的 Git 平台提供 fast path,消灭掉 git clone 带来的 overhead。

如果以上方式行不通的话,就会重新回退到之前的拉取方式。

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions