Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts is ~20M when built. Desired? #1365

Closed
Undo1 opened this issue Aug 27, 2016 · 20 comments
Closed

Charts is ~20M when built. Desired? #1365

Undo1 opened this issue Aug 27, 2016 · 20 comments

Comments

@Undo1
Copy link

Undo1 commented Aug 27, 2016

I just noticed that the new version of my app (which adds Charts, from Cocoapods) is much bigger than it previously was. After some digging, I found that the Charts framework is the culprit, weighing in at ~20MB in a built IPA file.

Does this sound correct? Is there a way to trim it down? I'm only using a very simple line chart, so I suspect there's stuff in here I don't really need.

@hardikdevios
Copy link

+1 even it takes time to Compile

@danielgindi
Copy link
Collaborator

Charts is just code, so it won't take so much.
Your app isn't Swift right?
Xcode adds libSwift to your app, which adds around 20MB to your project. That's normal, don't worry about it.

@Undo1
Copy link
Author

Undo1 commented Aug 29, 2016

@danielgindi My app is pure Swift, with the exception of XLForms (which was present before).

@Undo1
Copy link
Author

Undo1 commented Aug 29, 2016

To be clear about what I'm seeing (from an archive export):

MyApp 3 2016-08-27 09-37-49/Payload/MyApp 3.app/Frameworks » du -sh *                                                                                                                                                                                                                                                               parkererway@Development-9
 20M    Charts.framework
7.2M    MathParser.framework
2.9M    XLForm.framework
292K    libswiftContacts.dylib
 41M    libswiftCore.dylib
784K    libswiftCoreGraphics.dylib
252K    libswiftCoreImage.dylib
536K    libswiftDarwin.dylib
340K    libswiftDispatch.dylib
4.6M    libswiftFoundation.dylib
484K    libswiftObjectiveC.dylib
544K    libswiftUIKit.dylib
-----------------------------

@danielgindi
Copy link
Collaborator

The code itself, uncompiled, weight only a few hundred KBs, so I see no reason for this...

@danielgindi
Copy link
Collaborator

Now this is for the demo app, in debug mode. Highly unoptimized, with lot's of debugger overhead code...

screen shot 2016-08-29 at 11 03 10 pm

@Undo1
Copy link
Author

Undo1 commented Aug 29, 2016

Me neither. If it helps, I'm installing it with Cocoapods, and no Realm support (just pod 'Charts')

@danielgindi
Copy link
Collaborator

I see that MathParser.framework also takes up 7MBs. I'm not familiar with that framework, but it seems to be something that's even less code than a charting library. Should be a few KBs compiled.
I think there's something that's just very weird with your configuration...

@danielgindi
Copy link
Collaborator

Or could it be because of BitCode? Maybe the intermediate language that Apple uses to re-compile on their servers is MB hungry.

@Undo1
Copy link
Author

Undo1 commented Aug 29, 2016

I'll try compiling without Bitcode, that's an interesting hypothesis.

@Undo1
Copy link
Author

Undo1 commented Aug 29, 2016

Turning off Bitcode did nothing - if anything, it made it worse (!?). I'm going to agree that I have something bizarre in my project settings. I notice that even the libswift* frameworks in your screenshot are much smaller than mine.

@dxclancy
Copy link

dxclancy commented Aug 29, 2016

FWIW, in my archive from April (pre Xcode 8), Charts is 10MB.

Also note that "Highly unoptimized, with lot's of debugger overhead code..." doesn't necessarily mean smaller. My charts demo size analogous to daniel's above (i'm assuming that is from the iossimulator products folder?) is 4.4MB for debug and and 7.8MB for release.

@danielgindi
Copy link
Collaborator

@dxclancy "highly unoptimized" means larger binary

@danielgindi
Copy link
Collaborator

@Undo1 maybe you can post on Apple's forums about this?

@Undo1
Copy link
Author

Undo1 commented Aug 30, 2016

This seems to have been fixed by removing Cocoapods (completely) and manually including the .xcodeproj files for the various frameworks. I'm seeing Charts at 4.4MB in the archive now.

Thank you for your time on this!

@StarRain-L
Copy link

Excuse me,I met the same problem,and I didn't use cocopod, I just copy "Charts-master" file to my project,can you help me how to solve this issue?Don't know why my archive export so big.
eb28a52a-a44c-4cdb-9e7b-ada5a8cfc69f

@liuxuan30
Copy link
Member

liuxuan30 commented Jan 3, 2017

As I mentioned in your earlier post #2015, Charts itself is about 6.5M after optimization. The dylib you are posting is Swift libraries, which are essential to run any swift code, so far you can do nothing until swift is ABI stable and release with the OS, not the app. Once swift is packed into iOS, app does not need to embed swift lib any more.
With my experience, when you upload your app to App Store, Apple will do anther turn to optimize your app for user to download, so there is really no reason to worry about the size.

@StarRain-L
Copy link

You mean I don't care, this is no problem?Just see the blogger, wonder if something is wrong with my archive export.

@liuxuan30
Copy link
Member

It should be the least thing you need to worry.

@StarRain-L
Copy link

Ok, then I can try to archive export the secure, thank you very much,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants