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: アンドレ(Andre) <email@hidden>
- Date: Sun, 20 Mar 2005 17:33:06 -0800
On 平成 17/03/20, at 7:38, Marco Scheurer wrote:
On Mar 20, 2005, at 11:19, j o a r wrote:
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.
Right, it may work or not, but there is no Unicode comparison
involved (that doesn't even say that using NSNumbers as keys is
faster than using NSStrings: I don't know).
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.
There's a sparse array implementation in Mulle Kybernertik's EDCommon
framework (http://www.mulle-kybernetik.com/ ). It's probably worth a
look.
Yea, but its a little different than I expected, using NSMapTable....
if I wanted something 2-d or 3-d or even 4-d It would be too much of a
hassle I think...
Anyways, I think I know what to do from here!
Thanks guys.
_______________________________________________
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