Git Product home page Git Product logo

Comments (7)

hasjohnb avatar hasjohnb commented on July 21, 2024

The size of the Framework folder on your Mac is not the same as the size of the SDK in an app. Xcode is pretty smart about how it bundles and distributes binary libraries; it only includes the functions that are actually called. The last time I checked, with the minimum recommended implementation, the Tune SDK for iOS only added about 180 kB to the size of an application bundle, including all the other framework dependencies. Are you seeing something different than that?

from sdk-release.

MarkPerkins avatar MarkPerkins commented on July 21, 2024

Our issue is that we haven't enabled bitcode yet for our application because of some other dependencies that we use that haven't enabled that. I assuming the size of the framework itself (Tune.framework) is large because its building pre-compiled headers for all of the Valid Architectures (arm64 armv7 armv7s x86_64 i386). I guess until we can enable bitcode in our project we can't take advantage of just compiling just for the architecture required per device. I'm currently verifying the size difference you mentioned, and i'll get back to you on that.

from sdk-release.

MarkPerkins avatar MarkPerkins commented on July 21, 2024

I can verify that the framework in 40mb.. for each architecture it comes down to around 10mb.

lipo -detailed_info Dependencies/Tune/Tune.framework/Tune
Fat header in: Dependencies/Tune/Tune.framework/Tune
fat_magic 0xcafebabe
nfat_arch 4
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset 88
size 9486544
align 2^2 (4)
architecture armv7
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7
offset 9486632
size 9503496
align 2^2 (4)
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 18990128
size 9712056
align 2^3 (8)
architecture arm64
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
offset 28702184
size 10461992
align 2^3 (8)

from sdk-release.

MarkPerkins avatar MarkPerkins commented on July 21, 2024

So here is what i've done.. for the universal Tune target i changed these build options
Generate Debug Symbols: NO
Precompile Prefix Header: NO
Link With Standard Libraries: NO
that shrunk it to about half the size..

working on enabling bitcode now or embedding the framework a different way.

from sdk-release.

hasjohnb avatar hasjohnb commented on July 21, 2024

With the disclaimer that I haven't tried this in a couple of years (Xcode/iOS versions), I think the size of the library on disk is not correlated to the size that the SDK contributes to the application binary.

I'd recommend building an application without the SDK (possibly a new, empty app), then exporting it as an .ipa file and measuring the size of the archive. Then add the Tune SDK and dependencies to the app and look at how big the archive is. Note that if you don't call any functions from the Tune SDK, the archive size won't change (you can verify this), so you also have to add at least the initialization stuff to your app's code. This is how I arrived at the 180 kB number.

from sdk-release.

 avatar commented on July 21, 2024

Hi Mark, John is right that the size of the framework you copy into xcode doesn't all get added to the size of your app download because the compiled code is both thinned per architecture and compressed. The Tune framework is all code, so it compresses very well. There are more details on https://developer.apple.com/library/content/qa/qa1795/_index.html including the recommended way to measure your app download size.

I recommend following John's advice and examining an ad-hoc release archive of your app for seeing Tune's impact. There are instructions in the link above.

You can examine the compressed size of each item in the .ipa by opening Terminal and executing the following command:

unzip -lv /path/to/your/thinned_app.ipa

The size column has the compressed size of each file within your .ipa file. You should evaluate this size as you work to reduce the size of resources in your app. You may reduce the size of a resource by a lot, but after producing an .ipa file, you may discover the compressed size of that resource has not changed as dramatically. The most effective technique for reducing the size of an .ipa file is to remove unnecessary resources.

Of course, I'm not suggesting that you remove the Tune, framework :) rather, that the compressed size of the added Tune code will be significantly less than the size of the original framework package we provide.

from sdk-release.

MarkPerkins avatar MarkPerkins commented on July 21, 2024

Yup, I did my build and the results were correct..

Size..
193,642,968 - With Tune
192,104,987 - Without Tune
1,537,981 difference, which is about 1/4 what i expected it to be.

Thanks for your help everyone.

from sdk-release.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.