Re: [swift-users] Swift Binary Size vs. Obj-C
I'm seeing 7.375 MB for Swift 3 dylibs with a Release build, and I don't have WebKit, XPC, OnoneSupport, IOKit, CoreData, and AppKit in my binary when I create just a bare bones app. Thanks, Seth On Wed, Jun 15, 2016 at 5:59 PM Marco S Hymanwrote: > On Jun 15, 2016, at 5:37 PM, Seth Friedman via swift-users < > swift-users@swift.org> wrote: > > > > Does anyone know if the runtime libs definitively increased in size in > Swift 3? I could have sworn I heard 4.5 MB for Swift 2. > > The total of the Frameworks dir in a Swift 2.2 app I have is 5.8M. The > breakdown for this app is: > > 64KlibswiftAppKit.dylib > 4.8MlibswiftCore.dylib > 44KlibswiftCoreData.dylib > 112KlibswiftCoreGraphics.dylib > 32KlibswiftCoreImage.dylib > 84KlibswiftDarwin.dylib > 40KlibswiftDispatch.dylib > 516KlibswiftFoundation.dylib > 64KlibswiftObjectiveC.dylib > 48KlibswiftWebKit.dylib > > So how big might partially depend upon what frameworks the app uses. The > same app in Swift 3 is 6.6M -- a little bit bigger. It’s breakdown is: > > 76KlibswiftAppKit.dylib > 4.5MlibswiftCore.dylib > 44KlibswiftCoreData.dylib > 116KlibswiftCoreGraphics.dylib > 36KlibswiftCoreImage.dylib > 68KlibswiftDarwin.dylib > 40KlibswiftDispatch.dylib > 552KlibswiftFoundation.dylib > 36KlibswiftIOKit.dylib > 64KlibswiftObjectiveC.dylib > 1.0MlibswiftSwiftOnoneSupport.dylib > 48KlibswiftWebKit.dylib > 36KlibswiftXPC.dylib > > The Swift 3 version is a debug build, the swift 2.2 version isn’t. ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users
Re: [swift-users] Swift Binary Size vs. Obj-C
On Jun 15, 2016, at 5:37 PM, Seth Friedman via swift-userswrote: > > Does anyone know if the runtime libs definitively increased in size in Swift > 3? I could have sworn I heard 4.5 MB for Swift 2. The total of the Frameworks dir in a Swift 2.2 app I have is 5.8M. The breakdown for this app is: 64KlibswiftAppKit.dylib 4.8MlibswiftCore.dylib 44KlibswiftCoreData.dylib 112KlibswiftCoreGraphics.dylib 32KlibswiftCoreImage.dylib 84KlibswiftDarwin.dylib 40KlibswiftDispatch.dylib 516KlibswiftFoundation.dylib 64KlibswiftObjectiveC.dylib 48KlibswiftWebKit.dylib So how big might partially depend upon what frameworks the app uses. The same app in Swift 3 is 6.6M -- a little bit bigger. It’s breakdown is: 76KlibswiftAppKit.dylib 4.5MlibswiftCore.dylib 44KlibswiftCoreData.dylib 116KlibswiftCoreGraphics.dylib 36KlibswiftCoreImage.dylib 68KlibswiftDarwin.dylib 40KlibswiftDispatch.dylib 552KlibswiftFoundation.dylib 36KlibswiftIOKit.dylib 64KlibswiftObjectiveC.dylib 1.0MlibswiftSwiftOnoneSupport.dylib 48KlibswiftWebKit.dylib 36KlibswiftXPC.dylib The Swift 3 version is a debug build, the swift 2.2 version isn’t. ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users
Re: [swift-users] Swift Binary Size vs. Obj-C
Does anyone know if the runtime libs definitively increased in size in Swift 3? I could have sworn I heard 4.5 MB for Swift 2. Also, does anyone know if there are plans to introduce a `-Os` equivalent for Swift? (Yes, I'm using that in Obj-C, to answer your question). Thanks! Seth On Wed, Jun 15, 2016 at 5:27 PM Austin Zhengwrote: > Sorry, I totally missed the part where you mentioned the runtime libs. > > I assume you're compiling your Objective-C code using the `-Os` > optimization level? Unfortunately, it doesn't seem like swiftc has any > flags for trading off speed and binary size. Part of the size discrepancy > is almost certainly due to the immaturity of the compiler. > > This is probably only valid for the roughest of OOM estimates, but > LinkedIn's iOS app is 135 MB (don't know how it breaks down in terms of > assets vs code), and is almost entirely implemented in Swift. It's not much > to go off, but it might provide you with a starting point. > > If any of your company's engineers are at WWDC, you might want to have > them ask the engineers during the developer tools labs. > > Best, > Austin > > > On Wed, Jun 15, 2016 at 5:16 PM, Seth Friedman via swift-users < > swift-users@swift.org> wrote: > >> Thanks for the quick reply. You guys are right on part of it; the runtime >> libraries are causing the majority of the increase. I thought the Swift >> runtime libraries were supposed to only take up 4.5 MB though? Did they >> increase with Swift 3? If I add up all of the libraries, they take up a >> total of 22.88 MB in the binary. About how big would they be if I had >> Bitcode turned on? >> >> That said, the actual Swift binary is still larger. In my table view >> example, the Objective-C binary is 144 KB and the Swift binary is 201 KB. >> *That's >> still a 40% increase*. Obviously it's much harder to test a large-scale >> app, but I'd like to know the percentage increase to expect if we were to >> migrate to Swift. >> >> On Wed, Jun 15, 2016 at 5:04 PM Saagar Jha wrote: >> >>> Yep, I just took a simple app and opened up the ipa. 90% of it is the >>> “Frameworks” directory containing the Swift frameworks >>> libSwiftCore.dylib, libSwiftDarwin.dylib, etc. >>> >>> >>> On Wed, Jun 15, 2016 at 3:43 PM Seth Friedman via swift-users < >>> swift-users@swift.org> wrote: >>> Hi all, I've seen a ton of blog posts written about all of the cool and exciting things about Swift, but I haven't see anything really about the downsides (besides the occasional post about pain points with interoperability). What's of biggest concern to me when considering migrating my company's app from Objective-C to Swift is binary size. Swift binary size seems to be several times larger than Objective-C, and I'm curious what data there is in the community to support this suspicion. For some quick data points, I created a single view controller project in Obj-C and one in Swift, turned off bitcode to get a better idea of what the binary size on device would be, and archived them. I did this in Xcode 8 Beta 1 using Swift 3 so that I'd make sure to get any binary size improvements in Swift 3. The Obj-C IPA file was 639 KB. The Swift IPA file was *23.6 MB*. I know that the Swift runtime libs are about 4.5 MB, but subtracting that, the Swift IPA file is still *30x bigger than the Obj-C equivalent*. Next, I tried adding a simple table view controller, a Person model with a first and last name, and a data source that puts the first and last names in the table view in an attempt to make a functioning app. However, the binary sizes were about the same (the Obj-C one actually decreased to 635 KB). When we're talking about binary sizes this small, it's not a big deal, but my company's app is currently 81 MB, about 35 MB of which is code, and the rest is assets. If the code part of the binary size increases by orders of magnitude like this, we'll go way over the 100 MB cellular limit that Apple has set. This is also a really bad experience for customers in emerging markets like China and India that have poor connections. Can anyone confirm or deny that Swift binary size is orders of magnitude larger than Objective-C? I'm looking for the specific increase we'll see to take to my management in order to make a justification for whether it's worth it for our customers. Thanks! Seth Friedman ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users >>> -- >>> -Saagar Jha >>> >> >> ___ >> swift-users mailing list >> swift-users@swift.org >> https://lists.swift.org/mailman/listinfo/swift-users >> >> >
Re: [swift-users] Swift Binary Size vs. Obj-C
Sorry, I totally missed the part where you mentioned the runtime libs. I assume you're compiling your Objective-C code using the `-Os` optimization level? Unfortunately, it doesn't seem like swiftc has any flags for trading off speed and binary size. Part of the size discrepancy is almost certainly due to the immaturity of the compiler. This is probably only valid for the roughest of OOM estimates, but LinkedIn's iOS app is 135 MB (don't know how it breaks down in terms of assets vs code), and is almost entirely implemented in Swift. It's not much to go off, but it might provide you with a starting point. If any of your company's engineers are at WWDC, you might want to have them ask the engineers during the developer tools labs. Best, Austin On Wed, Jun 15, 2016 at 5:16 PM, Seth Friedman via swift-users < swift-users@swift.org> wrote: > Thanks for the quick reply. You guys are right on part of it; the runtime > libraries are causing the majority of the increase. I thought the Swift > runtime libraries were supposed to only take up 4.5 MB though? Did they > increase with Swift 3? If I add up all of the libraries, they take up a > total of 22.88 MB in the binary. About how big would they be if I had > Bitcode turned on? > > That said, the actual Swift binary is still larger. In my table view > example, the Objective-C binary is 144 KB and the Swift binary is 201 KB. > *That's > still a 40% increase*. Obviously it's much harder to test a large-scale > app, but I'd like to know the percentage increase to expect if we were to > migrate to Swift. > > On Wed, Jun 15, 2016 at 5:04 PM Saagar Jhawrote: > >> Yep, I just took a simple app and opened up the ipa. 90% of it is the >> “Frameworks” directory containing the Swift frameworks libSwiftCore.dylib, >> libSwiftDarwin.dylib, etc. >> >> >> On Wed, Jun 15, 2016 at 3:43 PM Seth Friedman via swift-users < >> swift-users@swift.org> wrote: >> >>> Hi all, >>> >>> I've seen a ton of blog posts written about all of the cool and exciting >>> things about Swift, but I haven't see anything really about the downsides >>> (besides the occasional post about pain points with interoperability). >>> What's of biggest concern to me when considering migrating my company's app >>> from Objective-C to Swift is binary size. Swift binary size seems to be >>> several times larger than Objective-C, and I'm curious what data there is >>> in the community to support this suspicion. >>> >>> For some quick data points, I created a single view controller project >>> in Obj-C and one in Swift, turned off bitcode to get a better idea of what >>> the binary size on device would be, and archived them. I did this in Xcode >>> 8 Beta 1 using Swift 3 so that I'd make sure to get any binary size >>> improvements in Swift 3. >>> >>> The Obj-C IPA file was 639 KB. The Swift IPA file was *23.6 MB*. I know >>> that the Swift runtime libs are about 4.5 MB, but subtracting that, the >>> Swift IPA file is still *30x bigger than the Obj-C equivalent*. Next, I >>> tried adding a simple table view controller, a Person model with a first >>> and last name, and a data source that puts the first and last names in the >>> table view in an attempt to make a functioning app. However, the binary >>> sizes were about the same (the Obj-C one actually decreased to 635 KB). >>> >>> When we're talking about binary sizes this small, it's not a big deal, >>> but my company's app is currently 81 MB, about 35 MB of which is code, and >>> the rest is assets. If the code part of the binary size increases by orders >>> of magnitude like this, we'll go way over the 100 MB cellular limit that >>> Apple has set. This is also a really bad experience for customers in >>> emerging markets like China and India that have poor connections. >>> >>> Can anyone confirm or deny that Swift binary size is orders of magnitude >>> larger than Objective-C? I'm looking for the specific increase we'll see to >>> take to my management in order to make a justification for whether it's >>> worth it for our customers. >>> >>> Thanks! >>> >>> Seth Friedman >>> >>> >>> ___ >>> swift-users mailing list >>> swift-users@swift.org >>> https://lists.swift.org/mailman/listinfo/swift-users >>> >> -- >> -Saagar Jha >> > > ___ > swift-users mailing list > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users > > ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users
Re: [swift-users] Swift Binary Size vs. Obj-C
Thanks for the quick reply. You guys are right on part of it; the runtime libraries are causing the majority of the increase. I thought the Swift runtime libraries were supposed to only take up 4.5 MB though? Did they increase with Swift 3? If I add up all of the libraries, they take up a total of 22.88 MB in the binary. About how big would they be if I had Bitcode turned on? That said, the actual Swift binary is still larger. In my table view example, the Objective-C binary is 144 KB and the Swift binary is 201 KB. *That's still a 40% increase*. Obviously it's much harder to test a large-scale app, but I'd like to know the percentage increase to expect if we were to migrate to Swift. On Wed, Jun 15, 2016 at 5:04 PM Saagar Jhawrote: > Yep, I just took a simple app and opened up the ipa. 90% of it is the > “Frameworks” directory containing the Swift frameworks libSwiftCore.dylib, > libSwiftDarwin.dylib, etc. > > > On Wed, Jun 15, 2016 at 3:43 PM Seth Friedman via swift-users < > swift-users@swift.org> wrote: > >> Hi all, >> >> I've seen a ton of blog posts written about all of the cool and exciting >> things about Swift, but I haven't see anything really about the downsides >> (besides the occasional post about pain points with interoperability). >> What's of biggest concern to me when considering migrating my company's app >> from Objective-C to Swift is binary size. Swift binary size seems to be >> several times larger than Objective-C, and I'm curious what data there is >> in the community to support this suspicion. >> >> For some quick data points, I created a single view controller project in >> Obj-C and one in Swift, turned off bitcode to get a better idea of what the >> binary size on device would be, and archived them. I did this in Xcode 8 >> Beta 1 using Swift 3 so that I'd make sure to get any binary size >> improvements in Swift 3. >> >> The Obj-C IPA file was 639 KB. The Swift IPA file was *23.6 MB*. I know >> that the Swift runtime libs are about 4.5 MB, but subtracting that, the >> Swift IPA file is still *30x bigger than the Obj-C equivalent*. Next, I >> tried adding a simple table view controller, a Person model with a first >> and last name, and a data source that puts the first and last names in the >> table view in an attempt to make a functioning app. However, the binary >> sizes were about the same (the Obj-C one actually decreased to 635 KB). >> >> When we're talking about binary sizes this small, it's not a big deal, >> but my company's app is currently 81 MB, about 35 MB of which is code, and >> the rest is assets. If the code part of the binary size increases by orders >> of magnitude like this, we'll go way over the 100 MB cellular limit that >> Apple has set. This is also a really bad experience for customers in >> emerging markets like China and India that have poor connections. >> >> Can anyone confirm or deny that Swift binary size is orders of magnitude >> larger than Objective-C? I'm looking for the specific increase we'll see to >> take to my management in order to make a justification for whether it's >> worth it for our customers. >> >> Thanks! >> >> Seth Friedman >> >> >> ___ >> swift-users mailing list >> swift-users@swift.org >> https://lists.swift.org/mailman/listinfo/swift-users >> > -- > -Saagar Jha > ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users
Re: [swift-users] Swift Binary Size vs. Obj-C
Yep, I just took a simple app and opened up the ipa. 90% of it is the “Frameworks” directory containing the Swift frameworks libSwiftCore.dylib, libSwiftDarwin.dylib, etc. On Wed, Jun 15, 2016 at 3:43 PM Seth Friedman via swift-users < swift-users@swift.org> wrote: > Hi all, > > I've seen a ton of blog posts written about all of the cool and exciting > things about Swift, but I haven't see anything really about the downsides > (besides the occasional post about pain points with interoperability). > What's of biggest concern to me when considering migrating my company's app > from Objective-C to Swift is binary size. Swift binary size seems to be > several times larger than Objective-C, and I'm curious what data there is > in the community to support this suspicion. > > For some quick data points, I created a single view controller project in > Obj-C and one in Swift, turned off bitcode to get a better idea of what the > binary size on device would be, and archived them. I did this in Xcode 8 > Beta 1 using Swift 3 so that I'd make sure to get any binary size > improvements in Swift 3. > > The Obj-C IPA file was 639 KB. The Swift IPA file was *23.6 MB*. I know > that the Swift runtime libs are about 4.5 MB, but subtracting that, the > Swift IPA file is still *30x bigger than the Obj-C equivalent*. Next, I > tried adding a simple table view controller, a Person model with a first > and last name, and a data source that puts the first and last names in the > table view in an attempt to make a functioning app. However, the binary > sizes were about the same (the Obj-C one actually decreased to 635 KB). > > When we're talking about binary sizes this small, it's not a big deal, but > my company's app is currently 81 MB, about 35 MB of which is code, and the > rest is assets. If the code part of the binary size increases by orders of > magnitude like this, we'll go way over the 100 MB cellular limit that Apple > has set. This is also a really bad experience for customers in emerging > markets like China and India that have poor connections. > > Can anyone confirm or deny that Swift binary size is orders of magnitude > larger than Objective-C? I'm looking for the specific increase we'll see to > take to my management in order to make a justification for whether it's > worth it for our customers. > > Thanks! > > Seth Friedman > > > ___ > swift-users mailing list > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users > -- -Saagar Jha ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users
Re: [swift-users] Swift Binary Size vs. Obj-C
Swift binaries are so massive currently because there's no ABI stability, therefore the runtime and support libraries must be packaged with every application. This should change in the future. Best, Austin On Wed, Jun 15, 2016 at 3:43 PM, Seth Friedman via swift-users < swift-users@swift.org> wrote: > Hi all, > > I've seen a ton of blog posts written about all of the cool and exciting > things about Swift, but I haven't see anything really about the downsides > (besides the occasional post about pain points with interoperability). > What's of biggest concern to me when considering migrating my company's app > from Objective-C to Swift is binary size. Swift binary size seems to be > several times larger than Objective-C, and I'm curious what data there is > in the community to support this suspicion. > > For some quick data points, I created a single view controller project in > Obj-C and one in Swift, turned off bitcode to get a better idea of what the > binary size on device would be, and archived them. I did this in Xcode 8 > Beta 1 using Swift 3 so that I'd make sure to get any binary size > improvements in Swift 3. > > The Obj-C IPA file was 639 KB. The Swift IPA file was *23.6 MB*. I know > that the Swift runtime libs are about 4.5 MB, but subtracting that, the > Swift IPA file is still *30x bigger than the Obj-C equivalent*. Next, I > tried adding a simple table view controller, a Person model with a first > and last name, and a data source that puts the first and last names in the > table view in an attempt to make a functioning app. However, the binary > sizes were about the same (the Obj-C one actually decreased to 635 KB). > > When we're talking about binary sizes this small, it's not a big deal, but > my company's app is currently 81 MB, about 35 MB of which is code, and the > rest is assets. If the code part of the binary size increases by orders of > magnitude like this, we'll go way over the 100 MB cellular limit that Apple > has set. This is also a really bad experience for customers in emerging > markets like China and India that have poor connections. > > Can anyone confirm or deny that Swift binary size is orders of magnitude > larger than Objective-C? I'm looking for the specific increase we'll see to > take to my management in order to make a justification for whether it's > worth it for our customers. > > Thanks! > > Seth Friedman > > > > ___ > swift-users mailing list > swift-users@swift.org > https://lists.swift.org/mailman/listinfo/swift-users > > ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users
[swift-users] Swift Binary Size vs. Obj-C
Hi all, I've seen a ton of blog posts written about all of the cool and exciting things about Swift, but I haven't see anything really about the downsides (besides the occasional post about pain points with interoperability). What's of biggest concern to me when considering migrating my company's app from Objective-C to Swift is binary size. Swift binary size seems to be several times larger than Objective-C, and I'm curious what data there is in the community to support this suspicion. For some quick data points, I created a single view controller project in Obj-C and one in Swift, turned off bitcode to get a better idea of what the binary size on device would be, and archived them. I did this in Xcode 8 Beta 1 using Swift 3 so that I'd make sure to get any binary size improvements in Swift 3. The Obj-C IPA file was 639 KB. The Swift IPA file was *23.6 MB*. I know that the Swift runtime libs are about 4.5 MB, but subtracting that, the Swift IPA file is still *30x bigger than the Obj-C equivalent*. Next, I tried adding a simple table view controller, a Person model with a first and last name, and a data source that puts the first and last names in the table view in an attempt to make a functioning app. However, the binary sizes were about the same (the Obj-C one actually decreased to 635 KB). When we're talking about binary sizes this small, it's not a big deal, but my company's app is currently 81 MB, about 35 MB of which is code, and the rest is assets. If the code part of the binary size increases by orders of magnitude like this, we'll go way over the 100 MB cellular limit that Apple has set. This is also a really bad experience for customers in emerging markets like China and India that have poor connections. Can anyone confirm or deny that Swift binary size is orders of magnitude larger than Objective-C? I'm looking for the specific increase we'll see to take to my management in order to make a justification for whether it's worth it for our customers. Thanks! Seth Friedman ___ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users