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 7696877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:52:55+00:00 2026-05-31T21:52:55+00:00

I was trying to add 200k messages to a core data object for a

  • 0

I was trying to add 200k messages to a core data object for a proof of concept of a twitter app. This works well and my entities are added. I have a UISearchBar and a UITableView to display these. However, for every new 1000 object, my time seems to be increasing exponentially. Is this normal ? I expected CoreData to perform well for huge datasets. Do you have better suggestion to handling such huge dataset. I wonder, how Dictionary apps work.

My Console Output is here:

-2012-03-26 22:19:28.126 TweetReader[3668:707] Done 1000
-2012-03-26 22:19:40.335 TweetReader[3668:707] Done 2000
-2012-03-26 22:19:55.136 TweetReader[3668:707] Done 3000
-2012-03-26 22:20:18.569 TweetReader[3668:707] Done 4000
-2012-03-26 22:20:50.166 TweetReader[3668:707] Done 5000
-2012-03-26 22:21:30.284 TweetReader[3668:707] Done 6000
-2012-03-26 22:22:19.096 TweetReader[3668:707] Done 7000
-2012-03-26 22:23:16.091 TweetReader[3668:707] Done 8000
-2012-03-26 22:24:21.321 TweetReader[3668:707] Done 9000
-2012-03-26 22:25:35.017 TweetReader[3668:707] Done 10000
-2012-03-26 22:26:57.250 TweetReader[3668:707] Done 11000
-2012-03-26 22:28:27.563 TweetReader[3668:707] Done 12000
-2012-03-26 22:30:06.202 TweetReader[3668:707] Done 13000
-2012-03-26 22:31:52.645 TweetReader[3668:707] Done 14000

Here it is my code to save into CoreData:

for (NSInteger i = 1; i <= 200000; i++) {

NSAutoreleasePool * myPool = [[NSAutoreleasePool alloc] init];

Tweet *tweetie = [NSEntityDescription insertNewObjectForEntityForName:@"Tweet" inManagedObjectContext:self.managedObjectContext];
    tweetie.name = [NSString stringWithFormat:@"%10d",i];
    tweetie.message =[NSString stringWithFormat:@"%10d",i];
    // Save the context after 1000 objects.
    if (! (i % 1000)) {
        NSError *error;
        NSLog(@"Done %d",i); 
        if (![managedObjectContext save:&error]) {
            NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
            abort();
        }

        [myPool release];
    }
}
  • 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-31T21:52:56+00:00Added an answer on May 31, 2026 at 9:52 pm

    Which columns do you have indexed on your database? Have you tried locking the context while you add to see if it can optimise this (i.e. do the inserts transactionally?)

    Core Data is notoriously bad at bulk inserts. The solution to this might just be to use sqlite directly – see this article for a real life case study of someone who had to do that : http://inessential.com/2010/02/26/on_switching_away_from_core_data

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

Sidebar

Related Questions

I'm trying add a tab to my web page that looks like this: Using
Trying to add email notification to my app in the cleanest way possible. When
Trying to add a class object into a List using reflection, but when invoking
Trying to add text to QGraphicsView: Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) { ui->setupUi(this);
Im trying to add an constructor to my webservice, that looks like this: public
Trying to add django-registration to my app. I have installed setup tools to use
Trying to add objects to a ArrayDeque at random intervals. This is what I
Trying to add public methods to this slider I purchased but have little knowledge
I trying add arrow buttons to my app. I dont know how to show
Trying to add a second line to this so it shows the Name of

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.