• 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: Send msg to object by nameed NSString;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Send msg to object by nameed NSString;


  • Subject: Re: Send msg to object by nameed NSString;
  • From: Trygve Inda <email@hidden>
  • Date: Wed, 18 Jun 2014 22:30:39 -0700
  • Thread-topic: Send msg to object by nameed NSString;

> A performance related argument: using property getters and setters in
> -initWithCoder: and -encodeWithCoder: can bring with them serious performance
> issues. Might not matter in your case, or in most cases, but it really adds up
> if you have a large and complex object graph. A recent exercise to set ivars
> directly in -initWithCoder: instead of using property setters saw a 100 - 600x
> speed improvement when reading a file for a graph with ~10,000 objects. Just
> sayin'.

Should I be doing:

self.myProperty = [coder decodeObjectForKey:kMyProperty];

(isn't that effectively the same as a getter/setter)?

Guessing it would be better as:

myProperty = [[coder decodeObjectForKey:kMyProperty] retain];

100x - 600x is a big hit.

Trygve




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Send msg to object by nameed NSString;
      • From: Graham Cox <email@hidden>
References: 
 >Re: Send msg to object by nameed NSString; (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Send msg to object by nameed NSString;
  • Next by Date: Re: Send msg to object by nameed NSString;
  • Previous by thread: Re: Send msg to object by nameed NSString;
  • Next by thread: Re: Send msg to object by nameed NSString;
  • Index(es):
    • Date
    • Thread