Carthage icon indicating copy to clipboard operation
Carthage copied to clipboard

Checkout spends a lot of time cloning submodules

Open CosynPa opened this issue 7 years ago • 3 comments

  • carthage version: 0.20.1
  • xcodebuild -version: 8.2.1(8C1002)
  • Are you using --no-build? YES
  • Are you using --no-use-binaries? YES
  • Are you using --use-submodules? NO
  • Are you using --cache-builds? NO

Cartfile

github "ReactiveCocoa/ReactiveCocoa"

I'm running carthage checkout --no-use-binaries, it is slow.

I insert some log in the cloneSubmoduleInWorkingDirectory signal producer:

screen shot 2017-03-15 at 10 02 58 am

This is the output:


[34;1m***[0m Checking out [1mResult[0m at [32m"3.2.1"[0m
[34;1m***[0m Checking out [1mReactiveSwift[0m at [32m"1.1.0"[0m
2017-03-14 13:53:58.433 carthage[57473:1990312] start clone submodule Carthage/Checkouts/Nimble @ 8e2703fabde578a6d28537c73844f84d48e71200
2017-03-14 13:53:58.458 carthage[57473:1990312] start clone submodule Carthage/Checkouts/Quick @ e4fa1e85c0305ba4e0866f25812d3fa398f3a048
2017-03-14 13:53:58.472 carthage[57473:1990312] start clone submodule Carthage/Checkouts/xcconfigs @ 3d9d99634cae6d586e272543d527681283b33eb0
2017-03-14 13:53:58.489 carthage[57473:1990307] start clone submodule Carthage/Checkouts/Result @ 2dd1a0c7bca4cc44082f72020fe8b14491056f88
2017-03-14 13:54:06.657 carthage[57473:1990308] complete clone submodule Carthage/Checkouts/xcconfigs @ 3d9d99634cae6d586e272543d527681283b33eb0
2017-03-14 13:54:23.253 carthage[57473:1990308] complete clone submodule Carthage/Checkouts/Result @ 2dd1a0c7bca4cc44082f72020fe8b14491056f88
2017-03-14 13:56:19.237 carthage[57473:1993541] complete clone submodule Carthage/Checkouts/Nimble @ 8e2703fabde578a6d28537c73844f84d48e71200
2017-03-14 14:00:21.046 carthage[57473:2009707] complete clone submodule Carthage/Checkouts/Quick @ e4fa1e85c0305ba4e0866f25812d3fa398f3a048
[34;1m***[0m Checking out [1mReactiveCocoa[0m at [32m"5.0.1"[0m
2017-03-14 14:00:21.164 carthage[57473:2009731] start clone submodule Carthage/Checkouts/Nimble @ 3720e6b0f6de6d6435f79f8a174fb4bb92df5dc4
2017-03-14 14:00:21.204 carthage[57473:2009755] start clone submodule Carthage/Checkouts/Quick @ e4fa1e85c0305ba4e0866f25812d3fa398f3a048
2017-03-14 14:00:21.276 carthage[57473:2009755] start clone submodule Carthage/Checkouts/xcconfigs @ 3d9d99634cae6d586e272543d527681283b33eb0
2017-03-14 14:00:21.315 carthage[57473:2009749] start clone submodule Carthage/Checkouts/Result @ 2dd1a0c7bca4cc44082f72020fe8b14491056f88
2017-03-14 14:00:21.349 carthage[57473:2009749] start clone submodule Carthage/Checkouts/ReactiveSwift @ c83de32f1adbcef89618cde4222f69a8bcecd7c2
2017-03-14 14:00:35.112 carthage[57473:2010340] complete clone submodule Carthage/Checkouts/xcconfigs @ 3d9d99634cae6d586e272543d527681283b33eb0
2017-03-14 14:00:43.678 carthage[57473:2010338] complete clone submodule Carthage/Checkouts/Result @ 2dd1a0c7bca4cc44082f72020fe8b14491056f88
2017-03-14 14:03:50.218 carthage[57473:2017892] complete clone submodule Carthage/Checkouts/Nimble @ 3720e6b0f6de6d6435f79f8a174fb4bb92df5dc4
2017-03-14 14:11:40.794 carthage[57473:2028920] complete clone submodule Carthage/Checkouts/Quick @ e4fa1e85c0305ba4e0866f25812d3fa398f3a048
2017-03-14 15:01:01.880 carthage[57473:2180717] complete clone submodule Carthage/Checkouts/ReactiveSwift @ c83de32f1adbcef89618cde4222f69a8bcecd7c2

We can see most of the time is spent cloning submodules, and the largest submodule is ReactiveSwift. But at the second line of log checking out ReactiveSwift itself only takes a few seconds. And also some submodules are duplicated, both ReactiveSwift and ReactiveCocoa have Nimble, Quick, Result, and xcconfigs as their submodules.

Many libraries are using submodules for managing dependencies, thus many of the submodules are already fetched in the Carthage cache. I believe at least cloning of these submodules can be optimized.

CosynPa avatar Mar 15 '17 02:03 CosynPa

I believe at least cloning of these submodules can be optimized.

Pull requests are welcome! 😃

ikesyo avatar Jul 12 '17 17:07 ikesyo

so what is the solution ?

kingsleyWH avatar Nov 28 '18 07:11 kingsleyWH

If https://github.com/Carthage/Carthage/pull/2655#issuecomment-517984909 is still accurate, then #2842 would still need to land to fix this issue.

1ec5 avatar Jan 09 '20 18:01 1ec5