well i would do this with a hashtable
prepared a dirty quick example and this only takes seconds on my system
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
' create 2 hughe arrays
Dim arrTestA(10000000) As Object
Dim arrTestB(10000000) As Object
For i As Integer = 0 To 10000000
arrTestA(i) = i
arrTestB(i) = 10500000 - i
Next
Dim arrTestC() As Object = ArrayDistinct(arrTestA, arrTestB)
MsgBox("ready")
End Sub
Public Function ArrayDistinct(ByVal ArrA() As Object, ByVal ArrB() As
Object) As Object()
Dim ht As New Hashtable(ArrA.Length)
For Each val As Object In ArrA
ht.Add(val, val)
Next
For Each val As Object In ArrB
If ht.ContainsKey(val) Then
ht.Remove(val)
End If
Next
Dim ret(ht.Count) As Object
Dim icount As Integer
For Each val As Object In ht.Values
ret(icount) = val
icount += 1
Next
Return ret
End Function
or is it not hughe enough