I think I will not implement Schmidts approach for fast class allocation and destruction because there is an risk for an memory leak.
If it would be an isolated area with no outside influence I would go that way. But here we have influence of "outside", means the end-user developing with the ListView control.
When the end-user developer now caches the ListItems and call .Clear then Schmidts approach will fail as the RefCounter was influenced by the end-user developer.
So there is always a risk here..
The only way I see to get an real performance boost in general is to get rid of the 1 Class usage per Row in the ListView control. (go the UDT way)
However, the down-side of this is that the end-user developer cannot compare two items if there are the same, e.g.
would not work anymore.Code:Private Sub ListView1_ItemClick(ByVal Item As LvwListItem, ByVal Button As Integer) If Item Is ListView1.ListItems(1) Then MsgBox "test123" End Sub
So question to everyone, which way to go? Or keep like it is?




Reply With Quote