473,387 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Speed Problem ... Performance HELP PLEASE...

Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i
could do to
improve my performanēe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in few
seconds ... :(

See my code below perhaps you can help ..

thks
JSB

Me.lvwAvailable.Sorting = SortOrder.None
Dim iNum As IEnumerator = Me.DataSet.Contacts.Rows.GetEnumerator

While (iNum.MoveNext)
itm = Me.lvwAvailable.Items.Add(iNum.Current("ContactID" ))
itm.SubItems.Add(IIf(iNum.Current("ContactName") Is
System.DBNull.Value, "", iNum.Current"ContactName")))
Application.DoEvents()
End While
Jul 21 '05 #1
6 1594
You can use BeginUpdate and EndUpdate...
http://msdn.microsoft.com/library/de...pdatetopic.asp

You might also want to break it up into smaller segments..there's no way you
can view more than a 100 or so items on the screen at once, so you can fire
additions whenever they scroll ....
HTH,
Bill
"Joćo Santa Bįrbara" <jo****@mail.telepac.pt> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i
could do to
improve my performanēe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in few
seconds ... :(

See my code below perhaps you can help ..

thks
JSB

Me.lvwAvailable.Sorting = SortOrder.None
Dim iNum As IEnumerator = Me.DataSet.Contacts.Rows.GetEnumerator

While (iNum.MoveNext)
itm = Me.lvwAvailable.Items.Add(iNum.Current("ContactID" ))
itm.SubItems.Add(IIf(iNum.Current("ContactName") Is
System.DBNull.Value, "", iNum.Current"ContactName")))
Application.DoEvents()
End While

Jul 21 '05 #2
Hi

What are you populating your Datase with? Maybe you can skip the dataset
Step and populate your listview stright from a DataReader.

Gary
"Joćo Santa Bįrbara" <jo****@mail.telepac.pt> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i
could do to
improve my performanēe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in few
seconds ... :(

See my code below perhaps you can help ..

thks
JSB

Me.lvwAvailable.Sorting = SortOrder.None
Dim iNum As IEnumerator = Me.DataSet.Contacts.Rows.GetEnumerator

While (iNum.MoveNext)
itm = Me.lvwAvailable.Items.Add(iNum.Current("ContactID" ))
itm.SubItems.Add(IIf(iNum.Current("ContactName") Is
System.DBNull.Value, "", iNum.Current"ContactName")))
Application.DoEvents()
End While

Jul 21 '05 #3
thks william
it works better, but i need more performance... :(

thks anyway
JSB

"William Ryan" <do********@comcast.nospam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You can use BeginUpdate and EndUpdate...
http://msdn.microsoft.com/library/de...pdatetopic.asp
You might also want to break it up into smaller segments..there's no way you can view more than a 100 or so items on the screen at once, so you can fire additions whenever they scroll ....
HTH,
Bill
"Joćo Santa Bįrbara" <jo****@mail.telepac.pt> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i could do to
improve my performanēe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in few
seconds ... :(

See my code below perhaps you can help ..

thks
JSB

Me.lvwAvailable.Sorting = SortOrder.None
Dim iNum As IEnumerator = Me.DataSet.Contacts.Rows.GetEnumerator

While (iNum.MoveNext)
itm = Me.lvwAvailable.Items.Add(iNum.Current("ContactID" ))
itm.SubItems.Add(IIf(iNum.Current("ContactName") Is
System.DBNull.Value, "", iNum.Current"ContactName")))
Application.DoEvents()
End While


Jul 21 '05 #4
sorry but i need the Dataset .. :(

ths
JSB

"Gary van der Merwe" <ga*****@hotmail.com> wrote in message
news:eW*************@TK2MSFTNGP10.phx.gbl...
Hi

What are you populating your Datase with? Maybe you can skip the dataset
Step and populate your listview stright from a DataReader.

Gary
"Joćo Santa Bįrbara" <jo****@mail.telepac.pt> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i could do to
improve my performanēe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in few
seconds ... :(

See my code below perhaps you can help ..

thks
JSB

Me.lvwAvailable.Sorting = SortOrder.None
Dim iNum As IEnumerator = Me.DataSet.Contacts.Rows.GetEnumerator

While (iNum.MoveNext)
itm = Me.lvwAvailable.Items.Add(iNum.Current("ContactID" ))
itm.SubItems.Add(IIf(iNum.Current("ContactName") Is
System.DBNull.Value, "", iNum.Current"ContactName")))
Application.DoEvents()
End While


Jul 21 '05 #5
Joao:

There's only so much you can do with a listview and that many records.
Faster processors and more Ram can help too, but that's probably not always
an option. There are some constraints that you are forced to deal with, and
10000 records in a Listview isn't going to be blazing fast. just look at
Windows Explorer when you have 2000 files in a directory....Slooowwww.

I'd really consider taking another look at my UI strategy if speed is that
important and you have to use a Listview. When the user scrolls, add
another 100 or 200 records. This will occur much faster and the user isn't
really needed 10,000 records in one place at one time. If the user scrolls
only once or not at all, the other records dont' get loaded (this way they
aren't penalized with load times for data they don't need). If they keep
scrolling, then they'll get only what they need, until they have
everything...then scrolling will be relatively fast.

Others may disagree, but I'd seriously reconsider my strategy there if I
have to use a Listview and have to have 10,000 records...

You know, you can do a lot with grids and set their bindings and maniuplate
their styles..they are probably architecturally better suited for this type
of heavy lifting.

HTH,

Bill
"Joćo Santa Bįrbara" <jo****@mail.telepac.pt> wrote in message
news:ev**************@TK2MSFTNGP09.phx.gbl...
thks william
it works better, but i need more performance... :(

thks anyway
JSB

"William Ryan" <do********@comcast.nospam.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
You can use BeginUpdate and EndUpdate...

http://msdn.microsoft.com/library/de...pdatetopic.asp

You might also want to break it up into smaller segments..there's no way

you
can view more than a 100 or so items on the screen at once, so you can

fire
additions whenever they scroll ....
HTH,
Bill
"Joćo Santa Bįrbara" <jo****@mail.telepac.pt> wrote in message
news:ue**************@TK2MSFTNGP11.phx.gbl...
Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i
could do to
improve my performanēe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in

few seconds ... :(

See my code below perhaps you can help ..

thks
JSB

Me.lvwAvailable.Sorting = SortOrder.None
Dim iNum As IEnumerator = Me.DataSet.Contacts.Rows.GetEnumerator

While (iNum.MoveNext)
itm = Me.lvwAvailable.Items.Add(iNum.Current("ContactID" ))
itm.SubItems.Add(IIf(iNum.Current("ContactName") Is
System.DBNull.Value, "", iNum.Current"ContactName")))
Application.DoEvents()
End While



Jul 21 '05 #6
Hi Joćo,

I'd remove that Application.DoEvents pronto. That will slow it down a lot. If you insist on having it there, have a
counter which only calls it once every few hundred items.

I'd give Bill's idea a good think about, too. Users don't like waiting for 10,000 records just to examine a few!! They
do appreciate good searching and filtering, though - it beats scrolling any day.

Regards,
Fergus
Jul 21 '05 #7

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

Similar topics

28
by: Maboroshi | last post by:
Hi I am fairly new to programming but not as such that I am a total beginner From what I understand C and C++ are faster languages than Python. Is this because of Pythons ability to operate on...
11
by: Fred Bennett | last post by:
I have a simulation project in which data can naturally be held in structures for processing. There are calls to multiple functions involved. Execution speed is an issue. Do I take a big hit for...
60
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...
6
by: Chua Wen Ching | last post by:
Hi there, 1) I am looking for the best collections techniques to be used in my program. Is hashtable or arraylist or any .net collection, which is the fastest when adding, getting out data???...
11
by: Sezai YILMAZ | last post by:
Hello I need high throughput while inserting into PostgreSQL. Because of that I did some PostgreSQL insert performance tests. ------------------------------------------------------------ --...
3
by: Mike Kelly | last post by:
Hi. I've built a page using standard ASP.NET 2.0 features and when I upload a large file (>20MB) to our intranet server, I get a paltry 100KB/s on our 100Mb/s LAN. Simply copying the file, I get...
9
by: burningsunorama | last post by:
Hi guys! This is maybe a too 'academic problem', but I would like to hear your opinions, something like pros and cons for each approach.... ... Recently we've had at work a little talk about the...
45
by: charles.lobo | last post by:
Hi, I have recently begun using templates in C++ and have found it to be quite useful. However, hearing stories of code bloat and assorted problems I decided to write a couple of small programs...
8
by: mast2as | last post by:
I am sure this topic has been discussed a thousand times and I read a few things about it today on the net. I also want to say I am trying to start a polemic here, I am just curious and willint to...
2
by: pavanip | last post by:
Hi, I have an application like Optimize System Performance by using Memory speed, cpu speed and Disk speed. How to optimize memory speed,disk optimization and CPU optimization. Please provide me...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.