• 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: Do IMPs move once they're loaded?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do IMPs move once they're loaded?


  • Subject: Re: Do IMPs move once they're loaded?
  • From: Bob Ippolito <email@hidden>
  • Date: Sat, 29 Jan 2005 17:31:52 -0500


On Jan 29, 2005, at 17:08, Ken Tozier wrote:

I want to cache IMPs in a dictionary for a class that reads many different data types from disk as quickly as possible. Would the following be a safe way to do this?

I wouldn't think that storing IMPs in a NSDictionary is going to be much faster than looking them up the normal way, if it's faster at all.


An IMP for a class that you write will change if it's swizzled [1] by Key-Value Observing, or replaced by a category or posing class... but other than that, I'm not aware of anything common that will change an IMP. However, I'd bet that sending two messages just to look up an imp is going to be slower than looking it up in the normal fashion. I have also never seen a good reason to cache IMPs for longer than the length of a message (unless you are swizzling something and need to call into the original imp, of course).

[1] http://www.cocoadev.com/index.pl?MethodSwizzling

-bob

_______________________________________________
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


References: 
 >Do IMPs move once they're loaded? (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: 2 NSDocuments with nib and info.plist problem
  • Next by Date: Re: NSController: Connections vs Bindings
  • Previous by thread: Do IMPs move once they're loaded?
  • Next by thread: Re: Do IMPs move once they're loaded?
  • Index(es):
    • Date
    • Thread