473,569 Members | 2,542 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Speed issues with filling a list view

I was wondering how you guys would handle filling a list view with something
like 10,000 items which each have 10 sub items on them... there has to be
major speed issues with that right? Yet, applications like outlook and such
can retrieve and display tens of thousands of emails with virtually no
performance hit at all... how would we go about getting a .NET listview to
get similar performance? when I try to do what I said above, it takes about
15 seconds or more to fill it with that much information and that is just
random test data... not real life from a database data either
Nov 21 '05 #1
5 3663
Welcome to the world of threading!

Load the visible page, then continue to load the rest in another thread.

There is a good example in chapter 10 of:
http://www.apress.com/book/bookDisplay.html?bID=173

The source code is available for download.

"Brian Henry" <no****@nospam. com> wrote in message
news:OM******** ******@TK2MSFTN GP11.phx.gbl...
I was wondering how you guys would handle filling a list view with
something like 10,000 items which each have 10 sub items on them... there
has to be major speed issues with that right? Yet, applications like
outlook and such can retrieve and display tens of thousands of emails with
virtually no performance hit at all... how would we go about getting a .NET
listview to get similar performance? when I try to do what I said above, it
takes about 15 seconds or more to fill it with that much information and
that is just random test data... not real life from a database data either

Nov 21 '05 #2
I do not think that it is a listview that is used; rather, I think that the
control is a datagrid. I also think that only that which is visible plus a
few more are actually loaded on initial load. The rest of the data is
loaded on demand to match the scrollbar. Counts, and pointers are the only
thing loaded on initial load.

"Brian Henry" <no****@nospam. com> wrote in message
news:OM******** ******@TK2MSFTN GP11.phx.gbl...
I was wondering how you guys would handle filling a list view with
something like 10,000 items which each have 10 sub items on them... there
has to be major speed issues with that right? Yet, applications like
outlook and such can retrieve and display tens of thousands of emails with
virtually no performance hit at all... how would we go about getting a .NET
listview to get similar performance? when I try to do what I said above, it
takes about 15 seconds or more to fill it with that much information and
that is just random test data... not real life from a database data either

Nov 21 '05 #3
The best performance I have gotten from a ListView is via
ListView.Items. AddRange(x)
where x is an array of ListViewItems. With the data volume you have,
I think the way to go is a worker thread that creates an array of
ListViewItems, loads data into the array, and from time to time calls
AddRange and reinitializes. Be aware of the need to execute AddRange on gui
thread rather than on the worker thread.

Nov 21 '05 #4
"Brian Henry" <no****@nospam. com> schrieb:
I was wondering how you guys would handle filling a list view with
something like 10,000 items which each have 10 sub items on them... there
has to be major speed issues with that right? Yet, applications like
outlook and such can retrieve and display tens of thousands of emails with
virtually no performance hit at all... how would we go about getting a .NET
listview to get similar performance?


You may want to use a virtual listview:

<URL:http://www.ilypsys-systems.co.uk/ils1controls.zi p>

Note that .NET 2.0's listview control will support a virtual mode
('VirtualMode' property) which allows to display millions of items
blindingly fast.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #5
wow you are right, doing an addrange increased our performance by a lot of
time. Before it took 4530 milliseconds to fill, now it only takes 635
milliseconds

"AMercer" <AM*****@discus sions.microsoft .com> wrote in message
news:E3******** *************** ***********@mic rosoft.com...
The best performance I have gotten from a ListView is via
ListView.Items. AddRange(x)
where x is an array of ListViewItems. With the data volume you have,
I think the way to go is a worker thread that creates an array of
ListViewItems, loads data into the array, and from time to time calls
AddRange and reinitializes. Be aware of the need to execute AddRange on
gui
thread rather than on the worker thread.

Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2140
by: Jeffrey Silverman | last post by:
Hi all, a request for opinions, please. I am designing a smallish application to manage members of several committees of a particula Organization. The structure of the system is as follows: theOrganization contains Committees which in turn contain People So theOrganization object is a list of Committee objects which are
15
2492
by: Guyon Morée | last post by:
Hi all, I am working on a Huffman encoding exercise, but it is kinda slow. This is not a big problem, I do this to educate myself :) So I started profiling the code and the slowdown was actually taking place at places where I didn't expect it. after I have created a lookup-table-dictionary with encodings like {'d':'0110', 'e':'01' etc}...
60
10099
by: Neil | last post by:
I have a situation with an ODBC linked view in an Access 2000 MDB with a SQL 7 back end. The view is scrolling very slowly. However, if I open the view in an ADP file, it scrolls quickly. I needed to use an ODBC link for the view because it needs to be editable. Otherwise, I would have used a pass-through query. In previous discussions...
6
9035
by: Brian Henry | last post by:
I was wondering how you guys would handle filling a list view with something like 10,000 items which each have 10 sub items on them... there has to be major speed issues with that right? Yet, applications like outlook and such can retrieve and display tens of thousands of emails with virtually no performance hit at all... how would we go about...
11
2148
by: Brian Henry | last post by:
Well here is the problem, I have a data set with about 9,000 to 20,000 people in it in the data table "people"... I am then reading it into a list view one at a time row by row... adding each person to the list view, well this works fine up to about 1,000 people then it start's to get really show putting the people in (a lot of process time...
2
2742
by: jphelan | last post by:
Ever since I successfully applied some techniques for increasing the speed of my 17 meg. Application; it has only made me hunger for more. First, let me list what I have done so far: 1. Split the application and database into front and back-ends, 2. Increased the load-time of my application by "pre-loading my heaviest forms when the...
5
2116
by: Alexnb | last post by:
Hello I am sure most of you are familiar with py2exe. I am having a bit of a problem. See the program has a few pictures involved and the .ico it uses for the windows. However, the pictures are stored in the same directory as the source, something like: C:\Docs and settings\me\My docs\python\program. When I run the program for the...
0
7700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.