ReDim and Array.Resize do not do the exact same thing—Array.Resize retains existing elements, but ReDim clears everything. Still we can compare the performance.
Module Module1
Sub Main()
Dim m As Integer = 10000000
Dim s1 As Stopwatch = Stopwatch.StartNew
' Version 1: use ReDim.
For i As Integer = 0 To m - 1
Dim x() As Integer = New Integer() {1, 2, 3}
ReDim x(5)
If Not x.Length = 6 Then
Return
End If
Next
s1.Stop()
Dim s2 As Stopwatch = Stopwatch.StartNew
' Version 2: use Array.Resize.
For i As Integer = 0 To m - 1
Dim x() As Integer = New Integer() {1, 2, 3}
Array.Resize(x, 6)
If Not x.Length = 6 Then
Return
End If
Next
s2.Stop()
Dim u As Integer = 1000000
Console.WriteLine(((s1.Elapsed.TotalMilliseconds * u) / m).ToString(
"0.00 ns"))
Console.WriteLine(((s2.Elapsed.TotalMilliseconds * u) / m).ToString(
"0.00 ns"))
End Sub
End Module
10.70 ns ReDim
70.40 ns Array.Resize