keith / rules_apple_linker

Bazel rules for overriding ld64 with lld or zld
MIT License
61 stars 7 forks source link

Slow linking when using lld #43

Open sanju-naik opened 1 year ago

sanju-naik commented 1 year ago

I tried adding lld linker to our project using rules_apple_linker & our project link time almost doubled instead of decreasing.

I added it as per the readMe instructions

ios_application(
    name = "MyApp",
    deps = [... + ""@rules_apple_linker//:lld""],
 )

That's it.

With Default Xcode 14.3 linker, link time for one of our project was 8-10 seconds, but with lld it increased to ~20 seconds.

I tried reproducing this on sample with few Cocoapods dependencies but no luck, there link time is alsmot same for both native & lld, link time is in ms there so it didn't really show difference I believe.

Anything I am missing in the setup? If not any pointers on how to debug this?

Thanks in advance!

keith commented 1 year ago

If you want to record a time trace of the slow link I'm happy to take a look!

sanju-naik commented 1 year ago

If you want to record a time trace of the slow link I'm happy to take a look!

Does sharing profile.qz trace file works? or you meant doing it with Xcode instruments?

keith commented 1 year ago

I meant one with instruments but that one might be useful too depending on how it was generated?