• 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
CoreData questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData questions


  • Subject: CoreData questions
  • From: malcom <email@hidden>
  • Date: Thu, 23 Mar 2006 10:29:19 +0100

Hello, I'm working with core data to modeling a set of classes to
store articles for a newsgroups.
Because I'm not an expert of modeling I would to get a suggestion to
get better performances.

In details I've created an entity called NGArticle that is an article
object. This class contains several attributes and three
releationship: hasHeader is a to-many releationship that referes to
the headers of an article; father is a releationship with destination
NGArticle that connect an article to it's father.
Childs it's another to-many releationship with destination NGArticle
that link an article to it's childs.

To get better performances I've stored main headers (date, from,
references and subject) as attributed instead of linking them using
hasHeader releationship.

Is this a good model?
I've used this stupid methods to see an indicative speed of Core Data.

int k;
	NSLog(@"start");
	for (k=0; k < 100000; k++) {
		NSManagedObject *art = [NSEntityDescription
insertNewObjectForEntityForName:@"NGArticle"
inManagedObjectContext:[self managedObjectContext]];
		[art setPrimitiveValue: [NSString
stringWithFormat:@"articolo1_%d",k] forKey:@"message_id"];
		[art setPrimitiveValue:nil forKey:@"padre"];

	}
NSLog(@"done");

It simply makes 100,000 records of NGArticle by setting some
properties. In my macbook it takes about 5 secs and 28 secs to store
it as SQLlite file. Is this a good time?
(what's the correct predicates to select all records?)

Thank you very much
malcom
 _______________________________________________
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: CoreData questions
      • From: malcom <email@hidden>
  • Prev by Date: Re: Source files - subclassing a nstableview
  • Next by Date: Re: NSTimer fires after invalidated - why?
  • Previous by thread: Re: value transformer for structs?
  • Next by thread: Re: CoreData questions
  • Index(es):
    • Date
    • Thread