• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Core Data] Improve save performance ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Core Data] Improve save performance ?


  • Subject: Re: [Core Data] Improve save performance ?
  • From: Shawn Erickson <email@hidden>
  • Date: Mon, 16 Jan 2006 16:30:41 -0800

On 1/16/06, Eric Morand <email@hidden> wrote:

> Anyway, SQLite persistent store is unusable for me. Here is what I've
> been doing to test its performance :
>
> - (IBAction) saveAction:(id)sender
> {
>         NSEntityDescription * anEntity = nil;
>         NSManagedObject * anObject = nil;
>
>         int index = 0;
>
>         while ( index < 1000 )
>         {
>                 anEntity = [NSEntityDescription entityForName:@"Account"
> inManagedObjectContext:[self managedObjectContext]];
>                 anObject = [[NSManagedObject alloc] initWithEntity:anEntity
> insertIntoManagedObjectContext:[self managedObjectContext]];
>
>                 NSLog (@"save");
>
>                 [[self managedObjectContext] save:nil];
>
>                 NSLog (@"end save");
>
>                 index++;
>         }
> }
>
> Well, this process (saving 1000 different object in the store, one at
> once) took...7 minutes !!!

OMG OMG (sorry !!! bugs me)

You already know that committing one object at at time has an overhead
around .5s... so why are you saving one at a time? Change the test to
save at the end to see how long a bulk operation takes.

Why do you have to commit after every time? Why can't you just build
up a set of dirty objects and commit them on a more reasonable
schedule.

> How can one feel satisfied with such subpar performances ?

What is the point of this statement? Who has said anything about being
satisfied with anything... this type of statement can easily be read
to imply any one but you is an idiot.

If you are concerned about the performance file a defect with a
reasonable real world implementation and/or open a Apple developer
technical support incident.

-Shawn
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [Core Data] Improve save performance ?
      • From: Eric Morand <email@hidden>
References: 
 >[Core Data] Improve save performance ? (From: Eric Morand <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: mmalcolm crawford <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: "Timothy J. Wood" <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Eric Morand <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Kay Roepke <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Eric Morand <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Scott Ellsworth <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Eric Morand <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Bill Bumgarner <email@hidden>)
 >Re: [Core Data] Improve save performance ? (From: Eric Morand <email@hidden>)

  • Prev by Date: Re: [Core Data] Improve save performance ?
  • Next by Date: Re: Quartz composer drag and drop problems
  • Previous by thread: Re: [Core Data] Improve save performance ?
  • Next by thread: Re: [Core Data] Improve save performance ?
  • Index(es):
    • Date
    • Thread