Re: [Core Data] Improve save performance ?
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