Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4083796
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:21:31+00:00 2026-05-20T18:21:31+00:00

Hi fellow Stackoverflow users, I am trying to optimize my iphone application startup time

  • 0

Hi fellow Stackoverflow users,

I am trying to optimize my iphone application startup time (i.e make the first view appear as soon as possible once the app is open). The section I want to optimize is the initialization of the Core Data stack (managed object context, persistent store coordinatorm, etc…) in the application delegate. I thought of two ways to solve this problem and wonder what are you thoughts(pros/cons) on those solutions (or other you may have) ?

Note: The Core Data Stack is initialized in the application delegate for the reasons given in Where to place the "Core Data Stack" in a Cocoa/Cocoa Touch application

Solution 1 (my prefered one):

Initialize the Core Data Stack in a background thread from the application delegate. This will allow the application initialization to be faster and the window/view to be displayed sooner.

Solution 2:

Lazy instantiate the Core Data Stack when a view controller requires access to the Core Data Stack. I like this idea however, the Core Data Stack should be initialized in the application delegate and then be passed on in each view controller which requires it.

Note: This solution breaks the convention of initializing the Core Data Stack in the application delegate.

Regards,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:21:31+00:00Added an answer on May 20, 2026 at 6:21 pm

    If you look at the standard Core Data utilizing templates, you will see that the stack is not initialized until some view controller calls for the managedObjectContext of the app delegate. So, the Core Data stack does not initialize until after a view requiring the managedObjectContext loads and begins to configure itself.

    The actual initialization of the stack is very lightweight and quick. Core Data doesn’t do much until you start actively generating the object graph and reading and writing to persistent store. Simply initializing the stack takes very, very little time.

    Sometime back I had similar concerns and did some test. I found out that the real lag in start ups is the loading of the first view, regardless of whether it used Core Data or not. I wasn’t able to measure any differences in startup time between having Core Data enabled and having it disabled.

    So, I wouldn’t bother with a non-standard initialization unless your own custom testing shows it causes some performance drag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using log4j for the first time in a project. A fellow programmer told
I'm currently trying to make a form called countcash that allows users to input
First time user of stackoverflow, but I have followed its development over on Coding
Hello fellow Stackoverflow users, I have a page which does a AJAX request to
Hello fellow StackOverflow users (or Stackoverflowers ?): I'm learning-by-coding WPF. I read several articles/saw
Question fellow programmers. Let's say I have a stand alone application in it's own
A follow on from this questions: http://stackoverflow.com/questions/3032598/rails-created-at-on-display-if-today Is it possible to output the word
A fellow stackoverflow member, @mrtsherman, helped me put together this little script that is
Hi fellow StackOverflow Members, I'm tired of bumping my head on the wall, so
Hello stackoverflow fellow members? Struct Declaration in class A struct PointSprite { GLfloat x;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.