Dictionary looping performance comparison

Posted by Shimmy on Stack Overflow See other posts from Stack Overflow or by Shimmy
Published on 2010-04-18T23:09:00Z Indexed on 2010/04/18 23:23 UTC
Read the original article Hit count: 477

I have the following 3 options, I believe there are more:

For Each entry In Me
Next

For i = 0 To Count
    Dim key = Keys(0)
    Dim value = Values(0)
Next

For Each Key In Keys
    Dim value = Me(Key)
Next

Personally, I think the For Each is best since the GetEnumerator is TKey, TValue based, but I donnu.

© Stack Overflow or respective owner

Related posts about dictionary

Related posts about performance-comparison