Projects

Ticket #361 (closed defect: fixed)

Opened 10 months ago

Last modified 9 months ago

Embed MacRuby Target Adds 60+ MB to .app

Reported by: dylan@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby 0.5
Component: MacRuby Keywords:
Cc:

Description

Expected:

Between 17(mentioned in presentation, not verified) MB and 30 MB (size of .dylib file) to be added to the output .app file on build from Xcode of the 'Embed MacRuby' target.

Observed:

The actual output file is over 69 mb, even with a base project with no code.

Steps to reproduce:

1.) open the attached project in Xcode 2.) select the embed macruby target in the Active Target box 3.) build 4.) check the file size of the resulting .app file

This embeds the whole framework, including all of the installed gems (including gems installed by the user!), tools, etc.

Work around:

Manually embedding the 'libmacruby.1.9.0.dylib' and using a copy files build step seems to work, but I haven't tested on systems without MacRuby yet.

Even with this 30mb seems a bit on the large side.

Attachments

OMGItsBig.zip Download (45.1 KB) - added by dylan@… 10 months ago.

Change History

Changed 10 months ago by dylan@…

Changed 10 months ago by lsansonetti@…

Are you using 0.4 or 0.5 (trunk)? The rewrite of the new VM in C++ plus the static inclusion of LLVM unfortunately grew up the size of MacRuby in trunk. The dylib is about 28MB here (which contains code for both i386 and x86_64, so it can be cut in half if necessary). Due to heavy STL inlining certain object files are very big, this is a shame. We have a plan to put some object files on diet and also move the LLVM stuff we need into a shared library.

Also, the Embed MacRuby target embeds everything, including the standard library, gems, and so on as you may have noticed. Most programs probably only need libmacruby.dylib. The target could potentially be changed to allow 2 modes, one that embeds everything and one that only embeds the dylib.

Changed 10 months ago by dylan@…

I'm using trunk, so that explains the size discrepancy.

How would I go about cutting the runtime size in half ?

Two ideas related to the embedding:

1.) Modify HotCocoa::ApplicationBuilder.deploy to take another argument, full deploy, which is false by default. If backwards compatibility is important here this could be changed to partial_deploy instead and default to the old behavior.

OR

2.) Add libmacruby.dylib to the project templates and use the standard copy framework build phase to deploy instead of the embed step

There are two primary problems with embedding as it currently stands:

1.) It picks up gems and probably shouldn't. The user should probably vendor any gems that should be included, explicitly. 2.) It picks up both the libmacruby-static.a and libmacruby.1.9.0.dylib files, which is why the size is doubled. The extra .rb scripts are very small in comparison.

Changed 9 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to MacRuby 0.5

As of r2905, the new Embed MacRuby target makes a fresh new MacRuby .app 49MB, and when passing --no-stdlib to macruby_deploy inside the target script the .app becomes 28MB.

We will make further improvements in the near future to reduce the size of embedded macruby apps, but I think this bug can be closed.

Note: See TracTickets for help on using tickets.