Quantcast
Viewing all articles
Browse latest Browse all 166

Why is fetching dependencies with SwiftPM so slow?

this problem isn’t new to me, but i’ve recently become more conscious of it now that i’ve started doing work in places that have “normal” internet connections, like my neighborhood Starbucks.

fetching dependencies with SPM takes a really long time, and it seems to disproportionately affect Apple packages like swift-collections.

Fetching https://github.com/apple/swift-markdown
Fetching https://github.com/apple/swift-collections.git
Fetching https://github.com/apple/swift-cmark.git
Fetching https://github.com/apple/swift-atomics.git
Fetched https://github.com/apple/swift-markdown (21.79s)
Fetched https://github.com/apple/swift-cmark.git (21.79s)
Fetching https://github.com/apple/swift-system.git
Fetched https://github.com/apple/swift-collections.git (21.81s)
Fetching https://github.com/apple/swift-nio-http2
Fetched https://github.com/apple/swift-atomics.git (3.44s)
Fetching https://github.com/tayloraswift/swift-grammar
Fetched https://github.com/apple/swift-system.git (3.43s)
Fetching https://github.com/tayloraswift/swift-hash
Fetched https://github.com/tayloraswift/swift-hash (1.09s)
Fetching https://github.com/swift-server/swift-backtrace
Fetched https://github.com/tayloraswift/swift-grammar (1.18s)
Fetching https://github.com/apple/swift-nio.git
Fetched https://github.com/swift-server/swift-backtrace (1.56s)
Fetching https://github.com/apple/swift-syntax
Fetched https://github.com/apple/swift-nio-http2 (30.78s)
Fetching https://github.com/apple/swift-nio-ssl.git
Fetched https://github.com/apple/swift-nio-ssl.git (44.06s)
Fetching https://github.com/tayloraswift/swift-mongodb
Fetched https://github.com/tayloraswift/swift-mongodb (7.99s)
Fetched https://github.com/apple/swift-syntax (103.10s)
Fetched https://github.com/apple/swift-nio.git (155.72s)

some of these packages, like swift-syntax are quite large and i am not surprised that they take a very long time to download. but others like swift-collections are tiny (in terms of source code footprint) and still take 21s to download. the only explanation i can think of is that SPM is fetching the entire repo history, because it should not take 21s to download the source code of a package like swift-collections.

is there anything that can be done about this?

12 posts - 9 participants

Read full topic


Viewing all articles
Browse latest Browse all 166

Trending Articles