Skip to content

Instantly share code, notes, and snippets.

@AlexDenisov
Created December 17, 2013 05:06
Show Gist options
  • Save AlexDenisov/8000321 to your computer and use it in GitHub Desktop.
Save AlexDenisov/8000321 to your computer and use it in GitHub Desktop.
CocoaPods vs Static Library
$ time xcodebuild -workspace ./BloodMagic.xcworkspace -scheme BloodMagic -config Debug -sdk iphonesimulator
# 40.31s user 4.15s system 288% cpu 15.435 total
$ time xcodebuild -project BloodMagic.xcodeproj -target BloodMagic -sdk iphonesimulator -configuration Debug build ARCHS=i386
# 18.64s user 2.31s system 282% cpu 7.404 total
@dodikk
Copy link

dodikk commented Dec 17, 2013

Your pod spec seems to not use a "prefix_header_file" parameter.
Hence, your pod library uses no precompiled headers. Which may be the reason of slow compilation.

@AlexDenisov
Copy link
Author

In case of static library I need to compile only my source code, in case of CocoaPods - I need to compile all the pods.It takes too much time after cleaning.
I use third-party pod.
How can I fix this as an end user? There is no way...

@dodikk
Copy link

dodikk commented Dec 17, 2013

Ok, your library build has an explicitly set architecture "ARCHS=i386"
Your cocoa pods build has not. Are you sure it does not build for multiple platforms (arm/x86)?

@dodikk
Copy link

dodikk commented Dec 17, 2013

In case of static library I need to compile only my source code

This is true only if the library vendor gives you a binary libXYZ.a or XYZ.framework. Otherwise you are in the same boat as the cocoa pods users.

@dodikk
Copy link

dodikk commented Dec 17, 2013

How can I fix this as an end user?

Send a bug report to the maintainer ?..
( this solves *.pch usage issue but not the dependencies thing )

@AlexDenisov
Copy link
Author

Both samples use i386 arch.

@AlexDenisov
Copy link
Author

This is true only if the library vendor gives you a binary libXYZ.a or XYZ.framework. Otherwise you are in the same boat as the cocoa pods users.

You're absolutely right.

How can I fix this as an end user?

Send a bug report to the maintainer ?..

It was rather a rhetorical question :)

@dodikk
Copy link

dodikk commented Dec 17, 2013

https://github.com/railsware/BloodMagic
BloodMagic.xcodeproj does not use statc libraries at all.
All sources are added using a "copy paste" style.

What is your benchmark measuring then?

@dodikk
Copy link

dodikk commented Dec 17, 2013

What is your benchmark measuring then?

No offence. I'm just trying to understand this behaviour.

@AlexDenisov
Copy link
Author

I've migrated to static library on another branch, but haven't pushed it to remote yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment