Re: Do IMPs move once they're loaded?
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