Question

I am considering using MonoTouch for some iPhone development, but payload size is an important factor.

For a user who has never installed Mono on their iPhone before, what would the size of an Objective-C "Hello World" app be compared to a MonoTouch "Hello World" app?

More specifically, what is the approx. number of bytes that need to be downloaded, and what is the approx. number of bytes used once installed?

Was it helpful?

Solution

A "Hello world" program in Objective-C occupies 50 KB (whole .app folder). With MonoTouch, a similar "Hello World" app occupies 5 MB (whole .app folder), which is not bad at all considering it has a runtime with garbage collection in it.

OTHER TIPS

In 1.5 Monotouch

A release build - that is a an application built with a distribution license - and with nothing but the default project settings, is 5 MB. Of that 4.3 MB is the binary executable.

They often rise to up to 10 MB in my experience, and the forums paint the same picture. The appstore reports the unzipped size, however they are downloaded zipped. Zipped it is around 3 MB which, even on a 3G, is fine.

In my view, most people won't look at the filesize before downloading an app, nor particularly care. The appstore limit for 3G downloads is now 20 MB which is well within the MonoTouch size.

To play devil's advocate, yes, it is many orders bigger than the Objective-C equivalent and could scare off a few people worried about occupying 4-10 MB more of their 16 GB space. However there is also time to market and the existing tools available for .NET. I develop and build all my MonoTouch apps in Visual Studio 2010 then test them on the Mac, and I don't think even Apple would argue their IDE is close to the industry leader.

From this question on MonoTouch and Size of Executables:

MonoTouch doesn't translate to Obj-c. It compiles to .NET IL, then compiles that (in the same way a JIT compiler would, but before it's run - hence "ahead of time" compiler) into native ARM code.

so:

Obj-C -> GCC (or LLVM) -> ARM code

vrs MT:

C# -> IL -> (AOT compiler) -> ARM code

The output binaries in 3.x are larger because you are also including a lot of the .NET framework (well, Mono Framework, but same-same), so if you, for eg, use System.Xml, it has to include that into the output - same with System.dll etc. The linker is pretty smart, but the output binaries are always going to be larger.

For me, the only size thing that matters is load time, and zipped binary size. Zipped binary for a "hello world" app is about 2.5-3meg (smaller in 4.x I'm told) vrs about 300k for obj-c. The difference gets less and less the more you add, as it only includes the likes of system.dll once. Load time for MT vrs Obj-c, doing the same things at the same time, is close enough to the same. Either one can be made to load slowly (just do something long running in your FinishedLaunching without putting it on another thread).

The answerer goes on to say that he feels that he is more productive with MonoTouch than Objective-C. YMMV.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top