• 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: Thu, 19 Jun 2014 06:31:19 -0700
  • Thread-topic: Send msg to object by nameed NSString;

>
> On 19 Jun 2014, at 3:30 pm, Trygve Inda <email@hidden> wrote:
>
>> Should I be doing:
>>
>> self.myProperty = [coder decodeObjectForKey:kMyProperty];
>>
>> (isn't that effectively the same as a getter/setter)?
>
> Yep, it's the same, so you will gain nothing there.
>
>
>> Guessing it would be better as:
>>
>> myProperty = [[coder decodeObjectForKey:kMyProperty] retain];
>
>
> Yes, this is what I meant. If you have declared your own ivars, it's far
> faster to set them directly.
>
>>
>> 100x - 600x is a big hit.
>
> It only starts to become noticeable when you are dearchiving a big graph
> though, so don't sweat it for one object. If you are relying on synthesizing
> the actual ivar, not just the setters/getters, you have little choice, though
> apparently you can rely on the ivar being the name of the property with a
> leading underscore. I dislike that sort of hidden magic however.
>
> I saw one file come down from taking 11 minutes (!) to 1.5 seconds to open
> with just this change.
>
>
> --Graham
>
>
>


I declare all my ivars but this case is small so I can't imagine an
improvement. I have one other place where it might help though. That one
takes about 2-3 seconds to open/read a file.




_______________________________________________

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


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

  • Prev by Date: Re: iOS app restarting from screen one. Why?
  • Next by Date: Re: iOS app restarting from screen one. Why?
  • 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