Thursday, April 2, 2009

Why Avoid using TDictionary

There are serious flaws in TDictionary in Delphi 2009. Try to avoid using it until a fixed version comes out. You can find a list of them in QC, but just to name two:
TDictionary.Clear() is flawed. If you clear the dictionary and then try to add another item to it, you will get an AV.
TDictionary.Add() is too slow. Adding 1000 elements in a Integer, Integer dictionary takes a few seconds.
There are probably more issues but these two are enough reason not to use TDictionary yet.

No comments: