As object and dictionary use the same syntax, it shouldn't be too hard to do some quick testing to determine which is faster when using strings as keys.
-J On Wed, May 28, 2008 at 2:28 PM, Daniel Freiman <[EMAIL PROTECTED]> wrote: > The short version is that I have a Directed Acyclic Graph class. The > example code was retrieving a node from the graph. I don't need weakKeys > because the node set is controlled. Anything in the Dictionary that would > be eligible for collection would have necessarily already been removed from > the Dictionary. So in the case of XML I'm now assigning a UID to an > attribute of the XML and using the value of that attribute as the key. It > didn't give me the performance increase I was hoping for, but it is better. > If an Object were faster than a Dictionary I would switch over, but if > they're equivalent I'll keep the Dictionary to key the Class more > generalized. > > - Daniel Freiman > > > On Tue, May 27, 2008 at 12:02 PM, Christophe Jolif <[EMAIL PROTECTED]> wrote: > >> Alex, >> >> >> Alex Harui wrote: >> > Dictionary keys should be objects. >> >> That's why I advised him to use Array not Dictionary... >> >> I must admit I don't know exactly what Daniel wants to do but his method >> name >> (getItem) reminds me a lot of similar things in Adobe Flex SDK such as >> ListBase.itemToItemRenderer method that are exactly doing what I propose. >> That's why I suggested him that workaround. But maybe I miss something... >> >> -- >> Christophe >> http://blogs.ilog.com/elixir/author/cjolif >> >> > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." :: Josh 'G-Funk' McDonald :: 0437 221 380 :: [EMAIL PROTECTED]