i using xamarin building app. before integrated parse in app, binary size (release build, optimizations, llvm, armv7 , arm64) 23mb. added parse xamarin sdk (using xamarin components) app , added 1 .cs file represent model on parse. after app size doubled 42mb, (i.e. increased 10mb per architecture).
my questions:
- why there such huge app bloat?
- is there way me app size down reasonable level?
additional details:
i used symbols information binary on symbols using additional space. (note: 1 architecture only)
get functions system namespace:
symbols testapp |grep func | grep 'system' | grep -v 'xamarin' | awk '{ print $3; }' | sed 's/)$//' | awk 'begin{sum = 0} { val = sprintf("%d\n", $0); sum += val; } end {print sum; }' before adding parse dll: 963kb
after adding parse dll: 4.5mb
the parse.ios.dll 212k. when compiled adds 3.6mb of code final binary:
symbols testapp |grep func | egrep 'parse|\[pf' | awk '{ print $3; }' | sed 's/)$//' | awk 'begin{sum = 0} { val = sprintf("%d\n", $0); sum += val; } end {print sum; }' 3639308 the added functions things along lines of:
0x000104f4 ( 0x260) system_array_internalarray__icollection_copyto_t_t___int [func, length, namedwarfmipslinkage, manglednamenlist, merged, nlist, dwarf, functionstarts] 0x000108f8 ( 0x64c) system_collections_generic_dictionary_2_intptr_system_weakreference_system_collections_icollection_copyto_system_array_int [func, length, namedwarfmipslinkage, manglednamenlist, merged, nlist, dwarf, functionstarts]
so looks lot code due generics being compiled native code. there way reduce amount of code bloat caused generics?
enable managed linker assemblies.
in project's ios build options, set "link behavior" "all assemblies"
more information linker: http://developer.xamarin.com/guides/ios/advanced_topics/linker/
more general build information (including how minimize app size) explained here: advanced ios build mechanics
Comments
Post a Comment