Reputation: 10296
I'm currently working on image processing related iPhone project and ran my intial tests on the device with Debug Builds. Performance was dissapointing to say the least. When I switched to a Release Build the performance was suddenly just great.
Judging from my experience as Windows Developer I've never seen such huge gains (several orders of magnitude faster in Release vs. Debug) from just switching to release mode - especially not for an application that leaves most of the heavy lifting to iOS itself. Anyone care to explain why MonoTouch is so much faster in Release mode?
Upvotes: 0
Views: 109
Reputation: 43553
There can be several reasons and you did not supply a lot of details. The most common reasons are:
First the obvious code is not optimized under the debug configuration, since some optimization makes debugging harder;
Debug build also needs to generates extra code compared to release builds (compare the final native executable size of your native executable to give you an idea how much it can represent);
Debug symbols (.mdb files) will be loaded at runtime. That will slow down the application startup but the required extra memory can also impact some applications;
The managed linker removes, in release builds, all the UI thread checks inside the UIKit bindings (i.e. they are only executed, and will only throw, in debug builds). That can be costly (in debug) if your application is looping on code that checks for thread safety.
If you have other options that differs, beside enabling debug, between your Debug
and Release
configurations then they might also have an impact on performance too. E.g.
If you want an answer specific to your application you should use Apple Instruments can compare both the debug and release builds.
Upvotes: 1