DictionaryBase Perfomance

  • Thread starter Thread starter parez
  • Start date Start date
P

parez

Hi all,


I want to use DictionaryBase as base class. The search performace
matters lot.
I have used a hashtable in a similar situation.

This class DictionaryBase has a innerhash table so i guess the
performace should be the same.

Question.

Would there be any perforamce difference for searching for the two
classes below.

Public Class LookUpCollection
Inherits DictionaryBase

End Class

Public Class LookUpCollection

private ht As Hashtable

end class


Thanks all in advance.
 
parez said:
Hi all,


I want to use DictionaryBase as base class. The search performace
matters lot.
I have used a hashtable in a similar situation.

This class DictionaryBase has a innerhash table so i guess the
performace should be the same.

Question.

Would there be any perforamce difference for searching for the two
classes below.

Public Class LookUpCollection
Inherits DictionaryBase

End Class

Public Class LookUpCollection

private ht As Hashtable

end class


Thanks all in advance.

No, performance is the same. One uses a hashtable, the other uses a
hashtable. Well, it could have a performance difference if you did
something different with your private hashtable (for example, the
DictionaryBase only creates the hashtable when the InnerHashtable getter is
accessed. So, when the Add, Remove, Contains, and GetEnumerator methods are
called, and there already isn't a hashtable created for the collection, the
one will be created at that time. If you call count, it will return 0 and
not create the hashtable if one is not already created.

HTH,
Mythran
 
Back
Top