Re: Faking large arrays in bindings to satisfy sparse data...
Re: Faking large arrays in bindings to satisfy sparse data...
- Subject: Re: Faking large arrays in bindings to satisfy sparse data...
- From: j o a r <email@hidden>
- Date: Sun, 20 Mar 2005 11:19:59 +0100
On 2005-03-20, at 10.57, Marco Scheurer wrote:
I thought about an NSDictionary, but this has speed disadvantages as
each key must be compared in unicode
when all I need is to compare numerals (positions in the sparse
array)....
Not necessarily: you can use NSNumbers as keys in an NSDictionary.
Unfortunately there is a weird performance regression with using
integer values wrapped in NSNumber as dictionary keys on Panther
(compared with Jaguar). It might, or might not, be an issue for you -
depending on how you plan to use this collection.
You can use a CFDictionary with integer keys, saving you the overhead
of having to wrap them in NSNumber instances. But IIRC that doesn't
perform quite as well as you might expect / want either.
I don't have a really good answer for you, but I think that regardless
of the underlying implementation you eventually choose for your custom
collection class it's a really good idea to make a set of functional
tests, and performance tests, to be able to monitor how it works.
j o a r
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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