Quote Originally Posted by Schmidt View Post
Update: The latest version is contained in the Zip below, with the following benefits:
- better performance
- RemoveByIndex and Remove (by Key) is now included
- variable Keys (incl. Objects), which can also be mixed

Here's the result of a performance-comparison to the MS-Scripting.Dictionary (native compiled, all options checked):


Ok, here the Zip with the new version (including the little PerformanceTest).
cHashDWithRemove.zip

Olaf
I just tried to copy this post code and try to build it to DLL and try it in VBA environment, the result of hash table runs slower than Ms's Dictionary !!!
Also on VB6 try with: Const Count As Long = 1048500

Code:
Sub HashTable_Dictionary()
    Const Count As Long = 1048500
    Dim SD As Scripting.Dictionary
    Dim i As Long, T@
    Set SD = New Scripting.Dictionary
    
    Dim HD As cHashTable
    Set HD = New cHashTable
    
    T = msTimer
    For i = 1 To Count
        SD.Add "khdkjhjhkjhkhkhkhkjhk " & i, i
    Next
    Debug.Print "Dictionary - AddItems", msTimer - T, SD.Count
    
    T = msTimer
    HD.ReInit Count
    For i = 1 To Count
        HD.Add "khdkjhjhkjhkhkhkhkjhk " & i, i
    Next
    Debug.Print "HashTable - AddItems", msTimer - T, HD.Count
End Sub
Attachment 180419