Skip to content

[update-checkout] add --partial-clone#87960

Merged
charles-zablit merged 1 commit into
swiftlang:mainfrom
charles-zablit:cz/update-checkout/faster-clone
Mar 20, 2026
Merged

[update-checkout] add --partial-clone#87960
charles-zablit merged 1 commit into
swiftlang:mainfrom
charles-zablit:cz/update-checkout/faster-clone

Conversation

@charles-zablit
Copy link
Copy Markdown
Contributor

This patch adds ways to speed up a fresh clone by doing 2 things:

  1. Doing a shallow clone (--depth 1) and only cloning one branch (--single-branch) when using the --skip-history flag.
  2. Fetch blobs on demand with --filter=blob:none with the --partial-clone flag.

This yields a 3x performance improvement when cloning all the repositories at desk:

./swift/utils/update-checkout --clone --clone-with-ssh --scheme main --skip-history --partial-clone
56.76s user 65.67s system 78% cpu 2:36.42 total

./swift/utils/update-checkout --clone --clone-with-ssh --scheme main 
471.02s user 184.06s system 156% cpu 6:58.65 total

@charles-zablit
Copy link
Copy Markdown
Contributor Author

@swift-ci please smoke test

@charles-zablit charles-zablit merged commit 65f5e36 into swiftlang:main Mar 20, 2026
3 checks passed
@finagolfin
Copy link
Copy Markdown
Member

@justice-adams-apple, I see that none of these flags are used on CI, would be good to add them where possible. We tried on the Android CI, but I see it isn't being applied.

Also, the Android PR CI doesn't seem to apply pulls from other repos, which Mishal said is a simple fix to add the --github-comment flag in your CI script, would be great if you'd add that too. 😺

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.

3 participants