Search code examples
c#objectlistview

Differences on VirtualObjectListView and FastObjectListView C#


I have been working on a few tests with this awesome control of Phillip Piper, but also I am having some questions that I cannot get answered (on the cooking book, source code examples and so on...).

What is the real difference between the FastOlv and VirtualOlv on loading and working with large lists?

Imagine for testing purposes only that: I have a List that is shown on both FastOlv and VirtualOlv. This List has 1.000.000 documents (loaded in memory) and that this List is not editable (no adding, removing or changing documents).

I have loaded this list to both OLVs and the performance is the same, I mean, the load time (and for example going from top to bottom on these OLVs) is the same.

What is the real benefit of using a VirtualOlv over a FastOlv? Is it all in the implementation of the IVirtualListDataSource that can be done to perform better for a particular situation? Can you share some examples?

Thank you for your insights on this.

Krs


Solution

  • Good question. You may want to take a look at the source code comments. The author isn't very specific, but reading through the comments and code helps to get an idea about the differences.

    Actually FastObjectListView is derived from VirtualObjectListView. But it uses a FastObjectListDataSource as VirtualListDataSource instead of the default VirtualListVersion1DataSource which is used by the VirtualObjectListView. Both are derived from AbstractVirtualListDataSource, but the FastObjectListDataSource overrides/implements many more functions including searching and sorting for example.

    Essentially it looks like the FastObjectListView does the work to extends the VirtualObjectListView by implementing functionality to behave like the ordinary ObjectListView. It also implements a GroupingStrategy which you could also add manually on any VirtualListDataSource.

    So it seems that, as long as you just display a large number of items in the list, there is no performance difference to be expected, since FastObjectListView actually is VirtualObjectListView with added functionality that can be optionally used.