I have a loop that checks for values and adds them to a dictionary if they do not exist. This check happens inside of a loop so it happens repeatedly. As the dictionary grows I imagine there is an inner loop going on with each check that is becoming costly. In an effort to speed up my entire routine I am wondering if this might be something I should optimize? If so, how?
keycnt = 1
For x = 1 to 500000
STRVAL = returnarray(8, x)
If Not STRDIC.Exists(STRVAL) Then
STRDIC.Add STRVAL, keycnt
keycnt = keycnt + 1
End If
next x