1. How can TMaps be faster than TLists or Arrays?
They aren't - at least not generally speaking. They're slower to insert, for starters. They grow as fast as TLists (constant time), but faster than arrays (linear time). Random access is slower than Arrays (constant), but faster than Lists (Linear). Sequential access is indifferent.One unique property of TMaps is that each Key can only exist once.
2. so if I put the object handle as the key and the value I have a real hashtable?
Not really. A HashTable lookup is in constant time, a TMap in logarythmic. Also two different objects (in memory) which have the same values in their fields, will have the same hash value, so will appear identical as far as a Hashmap is concerned. The handle won't. Seems like a practical thing to do anyway, good or bad?
I'd go for "bad" since it's unlikely you'll use the exact same object. Probably better to use a descriptive string or something for the key.