R
Ricardo Furtado
I've made a VB .Net application that use arrays, a lot. I'm optimizing my
application for speed because it is very slow, specially in the areas where
arrays are massively used.
I've searched in google and books and i found technics to speed up array
search but none of them referenced multi-dimensional arrays, so the question
i've been making for months remains:
How can i speed up multi-dimensional array search?
As an example i have the event listed bellow that is inserted in one of the
code areas where the windows task manager blows of scale and the cpu usage
reaches 100% and my application hangs for while (enough time for the
picturebox to present a red cross instead of the image)
Can You help?
Private Sub registerPointsInLstPoints(ByVal strPoint As String) Handles
MainDrawPics.registerPoints
Dim bolContinue As Boolean = True
Dim intCounter As Integer
Dim bolFound As Boolean = False
For intCounter = 0 To lstPoints.Items.Count() - 1
If lstPoints.GetItemText(lstPoints.Items().Item(intCounter)) =
strPoints Then
lstPoints.SetItemChecked(intCounter, True)
bolFound = True
Exit For
End If
Next
If Not bolFound Then
lstPoints.Items.Add(strPoints, True)
End If
End Sub
My thanks in Advanced
Ricardo Furtado
application for speed because it is very slow, specially in the areas where
arrays are massively used.
I've searched in google and books and i found technics to speed up array
search but none of them referenced multi-dimensional arrays, so the question
i've been making for months remains:
How can i speed up multi-dimensional array search?
As an example i have the event listed bellow that is inserted in one of the
code areas where the windows task manager blows of scale and the cpu usage
reaches 100% and my application hangs for while (enough time for the
picturebox to present a red cross instead of the image)
Can You help?
Private Sub registerPointsInLstPoints(ByVal strPoint As String) Handles
MainDrawPics.registerPoints
Dim bolContinue As Boolean = True
Dim intCounter As Integer
Dim bolFound As Boolean = False
For intCounter = 0 To lstPoints.Items.Count() - 1
If lstPoints.GetItemText(lstPoints.Items().Item(intCounter)) =
strPoints Then
lstPoints.SetItemChecked(intCounter, True)
bolFound = True
Exit For
End If
Next
If Not bolFound Then
lstPoints.Items.Add(strPoints, True)
End If
End Sub
My thanks in Advanced
Ricardo Furtado