Are ListViews really slow?

  • Thread starter Thread starter TryingLikeHeck
  • Start date Start date
T

TryingLikeHeck

I have an application that uses a LIstView.
Maybe 100 items each with 20 subitems.

The app looks at eack item and subitem twice.
I.e., it scans the entire set of data
item1, sub1,sub2,...
item2,sub1,sub2...
..
..
twice

I've never run it long enough for it to complete.
I'm using 3GHz CPU on an XPS by Dell

Could it be that accessing a ListView takes that long?

Thanks for any help
 
TryingLikeHeck said:
I have an application that uses a LIstView.
Maybe 100 items each with 20 subitems.

The app looks at eack item and subitem twice.
I.e., it scans the entire set of data
item1, sub1,sub2,...
item2,sub1,sub2...
.
.
twice

I've never run it long enough for it to complete.
I'm using 3GHz CPU on an XPS by Dell

Could it be that accessing a ListView takes that long?

Code?
 
Let see some code for populating the Listview.

Or Maybe you want to put a BeginEdit before you start adding items and an
EndEdit when your done that will help speed it up a little.
 
Sounds like something in your code.

I've currently got a project with a listview for Active Directory Domain
controllers and properties (properties in the subitems). In our domain,
there are currently 145 DC, so 145 listview items, each with 5 subitems. I
don't see any slowness there at all.

Jerry
 
I wouldn't access the ListView itself, but the datasource the you loaded it
from. That or just search the index of the listview. By default, you
really shouldn't use any sort of UI for your business logic

=CJ
 
You have 145 Domain Controllers???


Jerry Ham said:
Sounds like something in your code.

I've currently got a project with a listview for Active Directory Domain
controllers and properties (properties in the subitems). In our domain,
there are currently 145 DC, so 145 listview items, each with 5 subitems. I
don't see any slowness there at all.

Jerry
 
I have noticed the same thing. I also have an app that
can have well over a couple of thousand ListViewItems and
it is really slow to draw. I use the AddRange function
to do all the drawing but there isnt much difference from
just using the simple Add(). My code looks like this:

For idx = 0 To theFile.TestDataProp.PtrDataProp.Length - 1
elements(idx) = New ListViewItem
theFile.TestDataProp.
PtrDataProp(idx).DataProp)
Next
theFile.form.DrawGrid(elements,
theFile.form.ListViewDataProp())

Public Sub DrawGrid(ByRef ele() As ListViewItem, ByRef
grid As ListView)
grid.Items.AddRange(ele)
End Sub

could it be all that access of the form. I sort of
inherited the code base so i kept the basic structure i
was given

-paul
 
Yes - and over 2300 IP subnets and over 180 countries.
Major sites may have several DC's, minor sites have 1, and sites with less
than 100 users logon over the WAN.

Jerry
 
Thanks for the replies. From them I get the understanding that ListViews are
not noted for being slow so I'll continue to look for better ways of doing
what I'm doing. The code is not short and I wouldn't expect anyone to spend
the time necessary to study it. I have already found a few places where I
can save some data instead of scanning more than once .

It also has a few redim perserve's that may slow things down.

Thanks again
 
Hi Active,

Slow is always subjective.

When you have a very wide Wan, you will have many thin parts in the pipeline
and the listview will probably not be the most important in that.

When you are on a computer that has direct access the full datatable all the
time without any data access problem, your listview will become earlier a
part of that pipeline to get the data.

I think a good comparer is explorer, that is a listview also and the user is
accepting it.

Therefore, in my eyes, when your program is much slower than explorer in
colleting data, you have a problem.

Although when you use things as redim I really think, that you have to check
what the arraylist of other fast ilist class can do for you.

Just a though

Cor
 
We have 100 users here so we only use 2 of them. I understand that the
reasoning for so many, was just straight out impressed by the number. =)

How many users? 50k? 100k? What do you do?

-CJ
 
Just thought about this too and don't know if it was brought up, but did you
try to Suspend the layout (calling SuspendLayout) which would prevent it
from being painted and taking up other valuable CPU time.

-CJ
 
53,000 computers - slightly more users as there is some shift work, etc.
where they share machines.

I am a team lead on the team that designs our desktop image (Windows,
Office, custom apps, etc) and does custom coding for our image as well. We
create tools, etc. for the support staff to use.

Jerry
 
That is awesome. I have to ask, what is the name of the beast you work for?

I want to say something in insurance.. but I could be wrong.
 
Its an oil company - ChevronTexaco

Jerry

CJ Taylor said:
That is awesome. I have to ask, what is the name of the beast you work for?

I want to say something in insurance.. but I could be wrong.
 
I'll look at that too. The listbox is only being read and the display is a
PictureBox.
Nothing shows up on the display until all at once the entire display
appears.

Thanks
 
active said:
I'll look at ArrayList. This is a converted VB6 program
Thanks

You are using the ActiveX Listview, not the .NET Framework listview?? This
can explain a lot! Interop can sloooooow down things considerably - apart
from the fact CJ mentioned that one should work with the the datasource not
the UI.

(BTW, did you start the thread? Are you TryingLikeHeck? I'm unsure...)
 
Armin Zingler said:
You are using the ActiveX Listview, not the .NET Framework listview?? This
can explain a lot! Interop can sloooooow down things considerably - apart
from the fact CJ mentioned that one should work with the the datasource not
the UI.

The Properties list shows System.Windows.Forms.ListView
I think that means I'm using the >NET version. Right?
I don't actually remember deleting the old one and replacing it (I did so
much of that kind or thing.)
What made (makes?) you think I'm using the ActiveX version?

(BTW, did you start the thread? Are you TryingLikeHeck? I'm unsure...)
What does BTW stand for?
Yes. I have two ISP's
If I'm always online it's because I've converted a large app and as soon as
I clear up one problem I move on to another. And I've received wonderful
insight from this group. For example, the fact that just because single
stepping in the IDE highlights a statement does mean it actually got
executed. That's something it would take a long time to surmise. -
Numerous other things, like no use looking for a way to make the IDE
automatically compile only modules that have been changed since the last
compile. I was sure I only had to find the correct switch. Very helpful to
be told to stop looking. Anyway, I really appreciate the help and I am
trying.

I suggestion about ArrayList made me try dimensioning the arrays large
enough so that redim is never required, but that didn't help. There are
other thing going that may be using the time but I wanted to be sure
ListViews were not known to be time consumming.

Thanks for all the NG's past help and in particular your past help,
Cal
 
Back
Top