What has seemed to help is this: Removing references to System.Data and Mono.Data.SqlLite. They were both used in some code, but only code that was executed on the server, or in generic code (base libraries) where they were no longer needed. So for the code executed on the server (same code shared between both projects) I conditionally compiled all the System.Data code out of the iPhone side so I could remove the reference. This has shaved several seconds off the load time as it's fewer assemblies needing to be loaded. It's now down to about 12 seconds to start calling my code, which takes about 1.5 seconds in total until the "ViewDidAppear" ends on my first view.
Dino From: [email protected] [mailto:[email protected]] On Behalf Of Dean Cleaver Sent: Wednesday, May 30, 2012 8:54 To: Byron Sommardahl Cc: [email protected] Subject: Re: [MonoTouch] Speeding up startup Ummm - My startup is not being called until 17 seconds in. I can't speed up what isn't my code. And my startup takes 0.4 of a second, so I don't need to speed that up. I just need it called sooner than 17 seconds in. From: Byron Sommardahl [mailto:[email protected]]<mailto:[mailto:[email protected]]> Sent: Wednesday, May 30, 2012 8:45 To: Dean Cleaver Cc: Alan; HairyJohn; [email protected]<mailto:[email protected]> Subject: Re: [MonoTouch] Speeding up startup I really liked what Alan said and would be interested if it works in your case. Say you have 17 things that have to run before the app "launches", each taking 1 second to complete. Maybe for 10 of those things, it doesn't matter when they run/finish. So, execute those 10 things in a new task and forget about them. Then your start up should only take 7 seconds. For example: var task = Task.Factory.StartNew(() => { //do your async work here }); On Wed, May 30, 2012 at 6:50 AM, Dean Cleaver <[email protected]<mailto:[email protected]>> wrote: Hi, My FinishedLaunching completes in about half a second. It's just taking 17 seconds before that gets called. Dino -----Original Message----- From: [email protected]<mailto:[email protected]> [mailto:[email protected]<mailto:[email protected]>] On Behalf Of Alan Sent: Wednesday, May 30, 2012 4:11 To: HairyJohn Cc: [email protected]<mailto:[email protected]> Subject: Re: [MonoTouch] Speeding up startup Hi, Have you tried moving all logic out of the 'FinishedLaunching' override? You should not be doing expensive initialisation synchronously for precisely this reason - iOS will kill your app if it takes too long. For example wrap code in a Task which will execute on the background thread. You need to ensure you only touch the UI from your main thread though, http://docs.xamarin.com/ios/advanced_topics/threading . Alan On 30 May 2012 09:52, HairyJohn <[email protected]<mailto:[email protected]>> wrote: > I have the same problem with my app on my old 3G iPhone that I use to > test with iOS4. So would also be interested in any optimizations that > we can make. > > Cheers > Hairy > > -- > View this message in context: > http://monotouch.2284126.n4.nabble.com/Speeding-up-startup-tp4655096p4 > 655102.html Sent from the MonoTouch mailing list archive at > Nabble.com. > _______________________________________________ > MonoTouch mailing list > [email protected]<mailto:[email protected]> > http://lists.ximian.com/mailman/listinfo/monotouch _______________________________________________ MonoTouch mailing list [email protected]<mailto:[email protected]> http://lists.ximian.com/mailman/listinfo/monotouch _______________________________________________ MonoTouch mailing list [email protected]<mailto:[email protected]> http://lists.ximian.com/mailman/listinfo/monotouch
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
