rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

Executable bloat is becoming a serious problem #434

Open rromanchuk opened 9 years ago

rromanchuk commented 9 years ago

We won't start hearing about this until feb2015 when arm64 submission will be required, but I think it's a serious problem we should address now.

How to reproduce: motion create BWBloat

Add to your gemfile

app.archs['iPhoneOS'] = ['arm64', 'armv7']
app.archs['iPhoneSimulator'] << 'x86_64'

Now build the project and lets inspect the executable with nothing added:

ls -lh build/iPhoneSimulator-8.1-Development/BWBloat.app/BWBloat -rwxr-xr-x 2 ryan staff 3.8M Nov 3 13:01 build/iPhoneSimulator-8.1-Development/BWBloat.app/BWBloat 3.8MB for two architectures out of the gate.

Now add gem 'bubble-wrap', :github => 'rubymotion/BubbleWrap' to your gemfile followed by bundle install && rake

ls -lh build/iPhoneSimulator-8.1-Development/BWBloat.app/BWBloat -rwxr-xr-x 2 ryan staff 8.5M Nov 3 13:06 build/iPhoneSimulator-8.1-Development/BWBloat.app/BWBloat

We haven't written a single line of code yet and our current executable is now 8.5M. Sure, this is development build, but you can already see this is a serious issue. We haven't even included anything besides core yet. Obviously, this isn't exactly a BW problem, it's a rubymotion problem. At this point i would not advise anyone to use this library unless you completely understand what you have to give up.

rromanchuk commented 9 years ago

After a little bit of investigation i found that adding 30 empty class files adds 1.5mb to the executable https://github.com/rromanchuk/OMGBloat Interestingly enough, concatenating into one file the executable remained at 3mb

rromanchuk commented 9 years ago

Now being tracked by RM http://hipbyte.myjetbrains.com/youtrack/issue/RM-652

markrickert commented 9 years ago

Looks like this might be "fixed" in RM 2.38?